Hi
What is Similarity and Difference between Truncate and Delete in SQL ?
Loading
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
Rahul Bhatt165 reputationPosted Jul 20, 2012, 1:56 AM EDT
Diffrence ::
1. Delete :: Allowed Condition based Delete. (Use where clause)
Trunacter:: not allowed condition based Delete
2. Delete :: Rollback Data
Truncate :: not to rollback
Satyapriya NayakRank #47 · 31.5K reputationPosted Jul 20, 2012, 2:11 AM EDT
Jignesh TrivediRank #16 · 50.3K reputationPosted Jul 20, 2012, 2:12 AM EDT
Both used for removing Data from Data base.
Diffrence :
DELETE is a logged operation on a per row basis. TRUNCATE is also a logged operation, but in a different way. TRUNCATE logs the deallocation of the data pages in which the data
exists.
You cannot TRUNCATE a table that has any foreign key constraints , but you can DELETE those record.
TRUNCATE will reset any identity columns to the default seed value whereas DELETE is not.
TRUNCATE does not contain Where condition whereas DELETE has
Truncate Table is faster than Delete Table,
Truncate Table cannot activate a trigger.
hope this will help you.