Cristopher Coronado
What is the difference between Delete and Truncate?
By Cristopher Coronado in Databases & DBA on Aug 08 2020
  • Praveen Padle
    Aug, 2020 11

    If the table has identity column then truncate will restart the numbering but delete will not do that when new row is inserted it will seed form the last cached number

    • 2
  • Onkar Sharma
    May, 2021 15

    • 1
  • Andrei Fomitchev
    May, 2021 12

    Delete uses transactions and could be rolled back. Delete can use conditions to the rows to be deleted. Truncate just removes all data.

    • 1
  • jyoti kumari
    Jan, 2024 1

    Truncate delete all data from the table and we can not use where cluase. truncate recreate table stracture.delete used for remove all data from the table but we can use where cluase as per our requirement like one row and multiple conditions

    • 0
  • Avi sonawane
    Jun, 2021 18

    1)Delete can be undone using rollback but we can not rollback truncate . 2) in delete we can delete specific record but in truncate all record get deleted

    • 0
  • Mayank Kumar
    Apr, 2021 5

    delete command is used to delete data filter by a condition and truncate delete all the data at once.
    Truncate is faster than delete.

    • 0
  • Venkata Aditya Ravu
    Feb, 2021 13

    DELETE is DML command and TRUNCATE is DDL command. DELETE deletes records one by one and makes an entry for each and every deletion in the transaction log, whereas TRUNCATE de-allocates pages and makes an entry for de-allocation of pages in the transaction log

    • 0
  • Nisha Regil
    Sep, 2020 8

    DELETE The DELETE command is used to delete specified rows(one or more). It is a DML(Data Manipulation Language) command. There may be WHERE clause in DELETE command in order to filter the records. In the DELETE command, a tuple is locked before removing it. We can rollback the data even after using DELETE command. DELETE command is slower than TRUNCATE command. TRUNCATEThis command is used to delete all the rows from a table.It is a DDL(Data Definition Language) command.There is no WHERE clause in TRUNCATE command.In this command, data page is locked before removing the table data.In this command, we can’t rollback.TRUNCATE command is faster than DELETE command.

    • 0
  • Varun Setia
    Aug, 2020 18

    In Delete, the identity values are not removed in sequence. In truncate there is hard reset done on table. So, sequence remains unaltered in case of delete.

    • 0
  • Bipin Tiwari
    Aug, 2020 18

    Delete and truncate can rollback but if session closed then truncate can not rollback but delete can rollback by log file.

    • 0
  • Manish Verma
    Aug, 2020 11

    Delete is DML command. In which you can specify the tuple that you want to delete. Truncate is DDL command. It deletes all the tuples from a relation.

    • 0
  • Sam Khan
    Aug, 2020 11

    Well, TRUNCATE remove all the rows from tables , while delete can work with conditions.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS