Thursday 6 June 2013

Difference between truncate and delete

Truncate is a quick way to empty a table. 
It removes everything without logging each row. 
Truncate will fail if there are foreign key relationships on the table. 
Conversely, the delete command removes rows from a table, while logging each deletion and triggering any delete triggers that may be present.

No comments:

Post a Comment