ankit kumar
what is the difference between Delete and Truncate command in SQL
Posted by ankit kumar in SQL Server on Jan 07, 2011
  • 0
  • 1
  • 5615
Do you know the answer for this question? Post it below.
Posted by ankit kumar on Jan 07, 2011
  • 0

Delete -is a logged operation on a per row basis , this means that the deletion of each row gets logged and physically deleted. You can delete any row that will not violate a constraint,while leaving the foreign key or any other constraint in place.
is also a logged operation but in different way.Truncate logs the deallocation of the data pages in which the data exists. The deallocation of  data pages means that your data rows still actually
exists in the data pages but the extend have been marked as empty for  reuse this is what makes truncate a faster operation over delete. you can not truncate a table that has any foreign key  constraint . you will have to remove the constraint , truncate the table and reapply the