The T-SQL statement that deletes the table is:
DROP table < table name >
Drop is discarded, and drop table means that a table is completely erased.
There are two ways to delete table data: Delete and truncate.
The use of delete is as follows:
Delete from < table name > [Where Condition]
The usage of truncate is as follows:
TRUNCATE TABLE < name >
The difference between delete and truncate is as follows:
1. Delete can delete one or more data from a table, or delete all data, and truncate can only delete all the data in the table.
2. After delete deletes the table data, the identity field cannot be reused. In other words, if you delete the row of id=10 (if the ID is an identity field), you may not be able to insert a piece of data for id=10.
3. After truncate deletes the table data, the identity resumes its initial state. The default is the initial value of 1, that is, after truncate, insert one more data, id=1.
SQL Server methods for deleting tables and deleting data in tables