Delete Table vs Truncate Table

Question

What is the difference between delete table and truncate table operation

Answer

Delete table operation deletes all rows in the table. The deletion of rows is logged in the transaction log. On the other hand truncate table operation similarly deletes all rows in the table but it does not log the deletion of rows into the transaction log that is why it is faster. Truncate table operation can not be rolled back because it is not logged in the transaction log

Leave a Reply

%d bloggers like this: