What is the difference between TRUNCATE and DELETE commands?
Posted by Pradeep in SQL Server on Aug 20, 2009
  • 0
  • 3
  • 4671
Do you know the answer for this question? Post it below.
Posted by Priyadarshi Datta on Oct 30, 2009
  • 0

Delete&nbsp; is DML command&nbsp; used to delete rows from a table. A where clause can be used to remove some&nbsp; rows.If no where clause is specified all rows will be removed.After delete operation you need to commit or Rollback the transaction to make the transaction permanent or to undo it.<br><br>On the other hand Truncate is a DDL Command remove all rows from the table.The operation cannot be rolled back.As such truncate is faster and does not use as much undo space as delete.<br><input id="gwProxy" type="hidden"><!--Session data--><input onclick="jsCall();" id="jsProxy" type="hidden"><div id="refHTML"></div>

Posted by f k on Sep 07, 2009
  • 0

<P>delete is DML cmd so we hav to save after delete i.e. no autosave</P> <P>truncate is DDL cmd so autosave</P> <P>&nbsp;</P> <P>and truncate is faster than delete </P> <P>bcoz delete cmd deletes rows one by one&nbsp;</P>

Posted by Juan Lago on Aug 23, 2009
  • 0

<P>Truncate is faster than delete because the Delete command deletes the records row by row</P> <P>and command truncate delete all at once</P>

Most Popular Companies

Most Popular Job Functions