Difference between Delete and Truncate command
1. It allows to delete all rows as well as specific rows from table.
2. It deletes rows one by one.
3. Delete command is comes under DML & it does not deallocate the memory after deleting rows.
4. Id delete command is used to delete all rows of table then the Identity values will not get reset to its seed value.
5. It deletes the primary key rows data when there are no data in foreign key table.
1. Truncate command does not support where clause.
2. It can only be used when user want to delete all rows from table.
3. Truncate deletes table data page by page so deleting table data is faster as compared to delete command.
4. Truncate command comes under DDL & it deallocates the memory after deleting the data.
5. Truncate command resets the Identity value to its seed.
6. Truncate command cannot delete rows from primary key table even there are no rows in foreign key column table.