Interviews3 answers
What is the difference between Delete and a Truncate ?
3 Answers
delete is partialy deletion
but truncate delets with magic table also
Mukesh KumarPosted Sep 3, 2017, 12:49 AM EDT
when use delete cannot recreate deleted data.it is slow
use truncate can recreate .it is fast
Venkatesan MPosted Jun 28, 2016, 2:51 AM EDT
Delete
Does not reset the identity of the table
Its DML Command
It can be rolled back
Its Slower (Removes row one by one)
WHERE Condition can be used
Records entry in transaction log for each deleted row
Trigger can be activated
Truncate
Resets identity of the table
Its DDL Command
It cannot be rolled back
Its Faster (Uses Fewer systems)
WHERE Condition can't be used
Removes the data by de-allocating the data pages
Trigger can't be activated
Ajeet MishraPosted Sep 7, 2015, 11:27 PM EDT

