What is the difference between TRUNCATE and DELETE commands?

What is the difference between TRUNCATE and DELETE commands?

dinesh
Views: 3524 | Community Opinion: 6

Tags..  SQL Server  Database  Database Interview

Bookmark this page..



Ask a New Question Go to Home

Community Opinion/Answers
 
Mohit Said..

TRUNCATE is a DDL command whereas DELETE is a DML command. Hence DELETE operation can be rolled back, but TRUNCATE operation cannot be rolled back.
WHERE clause can be used with DELETE and not with TRUNCATE.




Kavita Joshi Said..

Using DELETE in a table with identity column means that identity value will never be used again. The TRUNCATE statement reset the identity value back to its original starting value.




Pratap Said..

hi





Delete command will be slow because every time it will notedown into logfile where as truncate won't touch log file.




tashi.. Said..

Delete command deletes data from the table row by row, but truncates removes the pages containing the records.




kishore Said..

delete it maintains log file when we delete records where as truncate does not






What do you think? Add your opinion/answer
*Name
*your opinion/answer: