What is the difference between TRUNCATE and DELETE in Sql?

Dung Do Tien Oct 19 2020 42

What is the difference between TRUNCATE and DELETE in SQL Server?

Please explain to me if you know them.

Have 1 answer(s) found.
  • Truncate & delete also to delete data from a table, and below is some difference between TRUNCATE and DELETE in SQL server:

    1. DELETE

    - Delete data from the table, can delete one or more records by using the WHERE clause. 

    - Not reset Identity increase value.

    - Commit and Rollback can be performed after DELETE statement.

     

    2. TRUNCATE

    - Delete all data from a table, can't delete some records.

    - Reset Identity increase value to 0.

    - Can not Rollback data after delete.

    Marry Christ Oct 19 2020
Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips