8.3.08

Truncate Vs Delete Statement

After deleting all the rows in the table, both will retain the table structure
* Truncate will delete all rows at a stretch where as delete statement will delete individual rows at a time.
* Truncate is comparatively faster than delete statement.
* Truncate is not a logged activity where as delete statement will create a log record in the LDF file.
* Truncate statement will remove the reference where as delete statement will delete the data itself.
* We cannot provide where condition in truncate statement where as its possible in delete statement.

2 comments:

  1. What do you mean by removing references?

    ReplyDelete
  2. Nice question, Its like an object. For object existence we need some reference else it will be collected by the systems cleanup routine.. here its server routine.

    Regards,
    Venkatesan Prabu .J

    ReplyDelete