Microsoft KB Archive/257334

= BUG: SQL Server Books Online States that TRUNCATE TABLE Is Nonlogged =

Article ID: 257334

Article Last Modified on 10/16/2003

-

APPLIES TO


 * Microsoft SQL Server 7.0 Standard Edition
 * Microsoft SQL Server 2000 Standard Edition

-



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.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

Keywords: kbbug kbpending KB257334

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.