Tuesday, June 12, 2012

TRUNCATE TABLE name

Per http://msdn.microsoft.com/en-us/library/aa260621(v=sql.80).aspx this command will drop all rows in a table. This is like DELETE * save that DELETE * will put a line item in a log for every row that is deleted where TRUNCATE is going to be much cleaner in interfacing with logs. One should use TRUNCATE if one knows one will not need to roll back a transaction and DELETE * if one is less brash.

No comments:

Post a Comment