3

Possible Duplicate:
What’s the difference between TRUNCATE and DELETE in SQL

what is the difference between truncate and delete command in sql query

Community
  • 1
  • 1
kailashnkute
  • 41
  • 2
  • 2
  • 3
  • 1
    http://stackoverflow.com/questions/139630/whats-the-difference-between-truncate-and-delete-in-sql – Romhein Feb 09 '10 at 13:30

1 Answers1

5

Delete marks each row as deleted (ghost record) and logs the individual row being deleted in the transaction log (in fully logged mode) or marks the page as being altered (in bulk logged). Delete permits a where clause, allowing the rows to be deleted, filtered.

Truncate removes the link from the table to the IAM and drops it on the floor, logging (bulk and full) the fact that it dropped the IAM, freeing up the space. Truncate removes all rows for the table, and can not be filtered.

Andrew
  • 26,629
  • 5
  • 63
  • 86