Truncate/delete Table
1, the meaning is to delete all records of the table
2, Truncate is a data definition language, the system will not write every record operation transaction log, unable to recover the record data operation
Truncate table deletes data by releasing the data page used to store the table data, and only records the page's release in the transaction log
The Delete data manipulation language stores the transaction log for each record of the operation and can recover the recorded data
3, if the table structure has the self-increment field
The trancate will start from the new increment count (for example, from 0 onwards)
Delete will not be counted from the beginning, and will be recorded from the deleted record (for example: ID self-increment (self-increment 1) Delete all records of the table 100, starting from 100 self-increment)
4, Truncate operation will be faster than delete
Trancate with less system and transaction log resources
Summary:
Which SQL Delete to use according to demand, if only to delete records do not need to restore, we recommend using truncate
Truncate Delete Usage