Introduction
This article is about comparing delete Vs truncate in SQL server, It is one of the most discussed topic on all SQL server forums, So there is no point in just discussing their basic difference, this article will be an elaborate one with supporting explanations.
Both delete and truncate command is used to for removing records from tables, the main difference between them lies in the way they perform this operation.
Delete Vs Truncate
Difference between delete and truncate can be summarized as below
|
Delete |
Truncate |
Command Type |
DML |
DDL |
Where Condition |
support |
does not support |
Reset Identity Column |
no |
yes |
Acquired lock |
row lock |
table and page lock |
Transaction log |
for each deleted row |
one log indicating deallocation of page |
Performance(Speed of execution) |
slow |
much faster than Delete |
Continue reading “Delete Vs Truncate in SQL Server”