What is difference between truncate and delete commands
Sql server commands
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Wim SturkenboomRank #2,527 · 554 reputationPosted Oct 2, 2014, 7:59 PM EDT
For me, the key points are: delete allows to delete an individual row and does not touch the identity counter; truncate deletes all rows and resets the identity counter.
Sahil SharmaRank #742 · 3.1K reputationPosted Oct 2, 2014, 11:33 PM EDT
Delete: It removes rows from a table using a where condition. It only removes the rows that matches the condition. Delete is a DML command.
Abhishek KumarRank #510 · 4.8K reputationPosted Oct 3, 2014, 12:57 AM EDT
Difference between Truncate and Delete in Sql server
TRUNCATE1. TRUNCATE is a DDL command.
2.Reset the indentity index.
3. Cannot use Where Condition.
4. It Removes all the data and
5. TRUNCATE TABLE cannot activate a trigger because the operation does not log individual row deletions.
6. Faster in performance wise, because it doesn't keep any logs.
7. Rollback is not possible.
DELETE
1. DELETE is a DML Command.
2. We can specify filters in where clause
3. It deletes specified data if where condition exists.
4. Delete activates a trigger because the operation are logged individually.
5. Slower than truncate because, it keeps logs.
6. Rollback is possible.
Hope this will help .
Abhishek