BUG: SQL Server Books Online States that TRUNCATE TABLE Is Nonlogged (257334)
The information in this article applies to:
- Microsoft SQL Server 7.0
- Microsoft SQL Server 2000 (all editions)
This article was previously published under Q257334
BUG #: 57685 (SQLBUG_70)
BUG #: 57687 (SQLBUG_70)
SYMPTOMS
The SQL Server Books Online article "Migrating TRUNCATE TABLE Statements from Oracle" states:
The TRUNCATE TABLE statement ... is used to remove all of the rows from a table. The table structure and all of its indexes will continue to exist; it cannot be rolled back.
Also, the SQL Server Books Online article "TRUNCATE TABLE (T-SQL)" states:
Because TRUNCATE TABLE is not logged, it cannot activate a trigger.
WORKAROUND
The page and extent allocations the TRUNCATE method require are logged, so TRUNCATE TABLE is partially logged and can be rolled back. While it is true that a TRUNCATE TABLE statement does not activate any DELETE triggers, the second statement should be reworded:
Because TRUNCATE TABLE does not log individual row deletions, it does not activate a trigger.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 10/16/2003 |
---|
Keywords: | kbBug kbpending KB257334 |
---|
|