SQL - How to delete table content quickly

The deletion of table content may take significant amount of time when the number of rows is large. This is so because every singe row deletion is logged into the database transaction log.
In the cases that the deletion log is not important you can simply remove the data rows w/o logging any individual row deletion by truncating the table:

TRUNCATE TABLE [TableName]


Reference:
http://msdn.microsoft.com/en-us/library/ms177570.aspx

No comments:

Post a Comment