Kuldeep's blog

Difference between Delete and Truncate

Removing records from a table is a crucial operation. So I would like to pen down my knowledge about removing records from a table. There are two ways to do the same, Truncate and Delete.

I would like to explain the basic difference between two.

1. Delete is a DML whereas truncate is a DDL. Truncate deallocates the data pages for the table and does'nt delete them row by row. So if there is an Identity column in the table it would be reset to initial seed after truncate.

Syndicate content

Who's online

There are currently 0 users and 4 guests online.

Recent Answers

Anonymous added a answer to LC3 Assembly Palindrome Program (8 weeks 2 days ago)
 
Anonymous added a answer to LC3 Assembly Palindrome Program (8 weeks 4 days ago)
 
Anonymous added a answer to Error-GetTypeHashCode()': no suitable method found to override (25 weeks 4 days ago)
 
Anonymous added a answer to AutoIncrement vs UniqueIdentifier (50 weeks 5 days ago)
 
vaibhav added a answer to Linq query on Datatable (1 year 1 day ago)
 
vaibhav added a answer to Delete Duplicate Records From a table (1 year 12 weeks ago)