FIX: UPDATE with FORCEPLAN ON May Cause Error 806 in Tempdb

Last reviewed: December 19, 1997
Article ID: Q171865
The information in this article applies to:
  • Microsoft SQL Server, version 6.5
BUG #: 17089 (Windows NT: 6.5)

SYMPTOMS

If an UPDATE trigger fires and contains an UPDATE that joins with the inserted table, the following error may occur if SET FORCEPLAN is set ON and the sysindexes count for syslogs number of pages is high:

   Msg 806, Level 21, State 1
   Could not find virtual page for logical page <page#> in database
   'tempdb'

WORKAROUND

To work around this problem, look for ways to avoid using SET FORCEPLAN ON with UPDATE statements including proper index design.

If you truncate the transaction log and/or run DBCC CHECKTABLE(syslogs) to update the sysindexes entries for syslogs, it is possible that the problem will not occur.

STATUS

Microsoft has confirmed this to be a problem in SQL Server version 6.5. This problem was corrected in the latest Microsoft SQL Server 6.5 U.S. Service Pack. For information on obtaining the service pack, query on the following word in the Microsoft Knowledge Base (without the spaces):

   S E R V P A C K

MORE INFORMATION

The following is a summary of the conditions that cause the problem to occur:

  • SET FORCEPLAN is set ON.
  • An UPDATE statement inside an UPDATE trigger joins with the inserted table.
  • The table being updated contains at least two rows.
  • The transaction log according to sysindexes.dpages has a large number of pages used.
Keywords          : kbbug6.50 SSrvTran_SQL kbfix6.50.sp4 kbusage
Version           : 6.5
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbworkaround


================================================================================


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: December 19, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.