代碼如下:
TRUNCATE TABLE (Transact-SQL)
Removes all rows from a table without logging the individual row deletions.
TRUNCATE TABLE is similar to the DELETE statement with no WHERE clause;
however, TRUNCATE TABLE is faster and uses fewer system and transaction log resources.
兩者的區(qū)別在于Truncate快,而且釋放日志所占資源,不記錄由于刪除行的影響所產(chǎn)生的日志。