开发者

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

This question already has answers here: 开发者_JAVA百科 Closed 12 years ago.

Possible Duplicate:

What’s the difference between TRUNCATE and DELETE in SQL

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜