Delete table and TRUNCATE TABLE
Use the DELETE statement to delete the general syntax format of the data:
Delete [from]
{table_name, view_name}
[Where<search_condition>]
Delete all row data in the XS table
Delete XS
After execution, it was found that the data in the XS table was deleted, but the structure of the table was still there.
Truncate
The TRUNCATE TABLE statement deletes all the data in the specified table, so it is also known as the Purge table data statement, which is generally formatted as follows
TRUNCATE TABLE name
Because the TRUNCATE statement will delete all the data in the table and cannot be recovered, you must use caution when using it.
All rows in the specified table are deleted using TRUNCATE TABLE, but the structure of the table and its columns, constraints, indexes, and so on, remain the same, and the count value used for the new row identity is reset to the initial value of the column. If you want to preserve the identity count value, use the DELETE statement.
TRUNCATE table executes faster than the delete block and uses less system and transaction log resources. The DELETE statement deletes one row at a time and records an entry in the transaction log for each row that is deleted. Instead, truncate table deletes data by releasing the data page used to store the table data, and records the release of the page only in the transaction log.
For a table that has a foreign key constraint reference, you cannot use TRUNCATE table to delete the data, but you should use the DELETE statement for the cloth bag where clause. Also, TRUNCATE TABLE cannot be used for tables that participate in indexed views.
From
Http://www.cnblogs.com/herbert/archive/2010/07/06/1772135.html
TRUNCATE TABLE and delete