The difference between TRUNCATE , DELETE and DROP is one of the most common interview question.
TRUNCATE
- Truncate uses the less transaction space than Delete statement.
- Truncate cannot be used with indexed views.
DELETE
- 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.
DROP
- 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.
get more detail to click
No comments