Delete vs Truncate vs Drop

One of the questions I get frequently is what is the difference between using DELETE versus using TRUNCATE versus using DROP when working with data in tables. It basically comes down to what do  you want to remove and what do you want to keep.

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.