BUG: Error 602 When Using Server Side Cursors

ID: Q198094


The information in this article applies to:
  • Microsoft SQL Server version 6.5

BUG #: 17985 (SQLBUG_65)

SYMPTOMS

When running an application that uses FORWARD ONLY or DYNAMIC server-side cursors, you may receive error 602 in the error log:

Msg 602, Level 2, State 15
Could not find row in Sysindexes for dbid '11', object '80003316', index
'1'. Run DBCC CHECKTABLE on Sysindexes. The SQL Server is terminating
this process.

This does not cause problems with the execution of SQL Server, but the client is disconnected from the server as stated in the message.


CAUSE

This problem occurs when all of the following conditions are true:

  • The query contains an equal join on two or more tables.


  • A search argument is applied to the join column on the inner table.


  • An ORDER BY clause is used on two or more columns.


  • The statement is being used as the record source for a cursor.


  • The cursor is defined as either a DYNAMIC or FORWARD ONLY cursor. If the cursor is called by the Transact-SQL syntax (for example, a DECLARE CURSOR statement) the problem does not occur.



WORKAROUND

To work around the problem, modify the query to not use one of the required conditions that cause this behavior, as noted in the CAUSE section of this article. For example, use a STATIC cursor instead of a DYNAMIC cursor or apply the search argument to the outer table and not the inner table.

As an additional workaround, you can do the following:

  1. Run showplan on the query you are basing the cursor on.


  2. Find the index that the query uses on the table listed in the message 602.


  3. Put an index hint in the query to force that index.



STATUS

Microsoft has confirmed this to be a problem in SQL Server version 6.5.

Additional query words: forwardonly errorlog

Keywords : SSrvTran_SQL kbbug6.50
Version : WINNT:6.5
Platform : winnt
Issue type : kbbug


Last Reviewed: April 20, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.