FIX: ROLLBACK of TRUNCATE TABLE May Cause Error 3301, AV

Last reviewed: April 8, 1997
Article ID: Q149939

The information in this article applies to:
  • Microsoft SQL Server, version 6.5
BUG#: 14849 (6.50)

SYMPTOMS

A TRUNCATE TABLE command that is aborted or rolled back may get a 3301 error "Invalid log record found in Syslogs (logop 42)" and an access violation.

CAUSE

If the truncated table has an IDENTITY column and the TRUNCATE aborts, or is inside a user transaction which later does a ROLLBACK, this problem can occur.

WORKAROUND

If the purpose of the TRUNCATE TABLE is just to remove all the rows, use DELETE with no WHERE clause. If the purpose is also to reset the IDENTITY value, use DELETE with no WHERE clause then TRUNCATE TABLE, and make sure there is no user defined transaction at the time of the TRUNCATE TABLE via logic such as

delete t1 while @@trancount > 0 begin

   commit tran
end truncate table t1

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5. This problem has been corrected in U.S. Service Pack 1 for Microsoft SQL Server version 6.5. For more information, contact your primary support provider.


Additional query words: sql65 truncate av 3301 syslogs
Keywords : kbbug6.50 kbfix6.50.sp1 kbprg SSrvProg
Version : 6.5
Platform : WINDOWS
Issue type : kberrmsg


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 8, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.