Delete vs Truncate vs Drop

Delete, Truncate, Drop

In this post, we will discuss the differences between DELETE, TRUNCATE, and DROP when removing data or tables. It comes down to what do you want to remove and what do you want to keep.

Delete Drop Truncate

First of all, the DELETE statement is used to remove individual records from a table while still keeping the underlying data pages and the table structure to be re-used to insert additional data.

TRUNCATE TABLE, on the other hand, does not care about removing individual rows, it will just remove the underlying data pages that are being used for the table. However, the table structure will still exist in this scenario as well.

DROP TABLE will completely remove the entire table structure from existence within the database.

Be the first to comment on "Delete vs Truncate vs Drop"

Leave a comment

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.