.NET and SQL Server interview question: - What is difference between truncate and delete?
Shivprasad Koirala
1) Delete has where condition. Truncate does not have where condition. 2) Delete records based on where condition but truncate delete all records from table. 3) Delete does not reset the identity of table. Truncate reset the identity of table. 4) Truncate is faster then delete.
Answer: Both Truncate and Delete are used to delete data from the tables. Below are some important differences.
TRUNCATE is a DDL (data definition language) statment whereas DELETE is a DML (data manipulation language) statement.