Wednesday, April 30, 2014

Differences between Delete and Truncate Commands

    DELETE TRUNCATE
1. It is DML command.     1. It is DDL command.
2. Deletes rows for Temporary     2. Deletes rows for permanent
3. Supports to delete rows on    conditional basis     3. No conditional deletion
4. When all rows are deleted,identity column value still    persist. Inorder toreset identity we need to use DBCC command     4. When all rows are deleted, identity col         value will be set to seed automatically.
5. It is slow in execution,since it consults log file to store  each deleted row    5. It is fast in execution since it does not consult log.

Thanks
GSV

No comments: