Database Tables  «Prev  Next»

Lesson 12 Deleting tables
ObjectiveDelete SQL-Server table

Deleting SQL tables

To delete a table, use the simple DROP TABLE Transact-SQL statement with the following syntax:
DROP TABLE table_name

For example, here's how you would delete, or drop, the employee table:
DROP TABLE employee

Note: You cannot drop a table that has a foreign key referenced in another table. You must first drop the foreign key. If the table contains data, the data will be deleted when the table is deleted. The next lesson concludes this module.


SEMrush Software