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
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Oct 17, 2022, 6:38 AM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted Oct 17, 2022, 6:45 AM EDT
Please refer these link which has good informatice details,
https://www.c-sharpcorner.com/blogs/difference-between-truncate-delete-and-drop-in-sql-server1
https://www.mssqltips.com/sqlservertip/4248/differences-between-delete-and-truncate-in-sql-server/
Brahma Prakash ShuklaRank #633 · 3.8K reputationPosted Oct 17, 2022, 11:54 AM EDT
TRUNCATE and the DELETE statement both come under SQL query for delete operation. They perform deletion operations on unwanted records or rows of a table. In the DELETE statement, the rows from the table get deleted with a condition. In simple words, one or more rows can be deleted at once. but in the TRUNCATE command, all the rows get deleted at once.
When we use the DELETE query, a log is created for every row in the transaction log. This way we can get back the records using ROLLBACK before COMMIT. Also, when using TRUNCATE, we can get the records back using ROLLBACK. The difference is that TRUNCATE only logs the deallocation of the page where data is stored.