Delete command remove the rows from table based on the condition provided in where clause. Truncate will remove all the data from table. After deleting we can rollback but after truncate we can’t rollback.
The other main difference are below:-
a) Truncate is DDL command while DELETE is DML command.
b) TRUNCATE resets the identity of the tables while DELETE doesn’t reset the identity of the table.
c) TRUNCATE can not be rolled back while delete can be rolled back.
No comments:
Post a Comment