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
Hello Cristopher Coronado,
Please refer this link which will help you,https://www.c-sharpcorner.com/article/difference-between-delete-truncate-and-drop-statements-in-sql-server/
Delete uses transactions and could be rolled back. Delete can use conditions to the rows to be deleted. Truncate just removes all data.
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
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
delete command is used to delete data filter by a condition and truncate delete all the data at once.Truncate is faster than delete.
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
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.
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.
Delete and truncate can rollback but if session closed then truncate can not rollback but delete can rollback by log file.
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.
Well, TRUNCATE remove all the rows from tables , while delete can work with conditions.