The difference between TRUNCATE, DELETE, and DROP is one of the most common interview questions.
- Truncate uses the less transaction space than Delete statement.
- Truncate cannot be used with indexed views.
- DELETE is a DML command.
- DELETE is executed using a row lock, each row in the table is locked for deletion.
- We can use where clause with DELETE to filter & delete specific records.
- The DROP command removes a table from the database.
- All the tables’ rows, indexes, and privileges will also be removed.
- No DML triggers will be fired.
- The operation cannot be rolled back.
Already reacted for this post.