What is the basic difference between DELETE and TRUNCATE commands?
- It is a DML command
- We can use filters in WHERE clause to delete the data
- Removes specified data only
- Deletes one row at a time
- Records removed data in transaction logs
- It does not resets the identity field of the table
- Triggers can be executed with Delete statement.
- Slower than Truncate since it has to maintain logs and checks for WHERE condition
- It is a DDL command
- We can’t use WHERE condition
- Removes all the data
- Removes all the data at a time
- It does not records into transaction logs
- Resets the Identity field
- Triggers can not be executed with Truncate.
- Faster than DELETE