Thursday, August 16, 2012

What is the difference between DELETE and TRUNCATE?

Answer:

 
Following are difference between them:

• DELETE TABLE: - syntax logs the deletes thus making the delete operations low.

 TRUNCATE table does not log any information but it logs information about deallocation of data page of the table. So TRUNCATE table is faster as compared to delete table.

• DELETE table can be rolled back while TRUNCATE cannot be.

• DELETE table can have criteria while TRUNCATE cannot.

• TRUNCATE table cannot have triggers.

No comments:

Post a Comment