MS SQL Server Concepts and Programming Question: Download Questions PDF
How To Drop an Existing Table with "DROP TABLE" Statements in MS SQL Server?
![MS SQL Server Interview Answer MS SQL Server Interview Question](https://globalguideline.com/public/images/interview/13.png)
Answer:
If you want to delete an existing table and its data rows, you can use the "DROP TABLE" statement as shown in the tutorial script below:
SELECT * FROM tipBackup
GO
id subject description create_date
1 Learn SQL Visit www.globalguideline.com 2006-07-01
DROP TABLE tipBackup
GO
SELECT * FROM tipBackup
GO
Msg 208, Level 16, State 1, Line 1
Invalid object name 'tipBackup'.
Be careful, when you use the "DROP TABLE" statement. All data rows are gone too.
SELECT * FROM tipBackup
GO
id subject description create_date
1 Learn SQL Visit www.globalguideline.com 2006-07-01
DROP TABLE tipBackup
GO
SELECT * FROM tipBackup
GO
Msg 208, Level 16, State 1, Line 1
Invalid object name 'tipBackup'.
Be careful, when you use the "DROP TABLE" statement. All data rows are gone too.
Download MS SQL Server Interview Questions And Answers
PDF
Previous Question | Next Question |
How to rename an existing table with the "sp_rename" stored procedure in MS SQL Server? | What Are DML (Data Manipulation Language) Statements in MS SQL Server? |