BUG: Error 602 While Fetching from a Cursor Defined on a View

Last reviewed: April 22, 1997
Article ID: Q165130
The information in this article applies to:
  • Microsoft SQL Server, versions 6.0 and 6.5
BUG#: 16646 (6.5)

SYMPTOMS

If you fetch from a cursor defined on a view owned by a user other than the owner of the underlying base table, and there are identical object names for the view and the table, you will receive the following error message, and the client connection will be terminated:

   Error 602, Severity: 21, State 3
   Could not find row in Sysindexes for dbid '4', object
   '1232007420',index '-1'.
   Run DBCC CHECKTABLE on Sysindexes.

For example, a view called "authors" created by user "Bill" in the pubs database defined on the underlying "dbo" owned "authors" table will give error 602 when Bill attempts to fetch from a cursor on this view.

CAUSE

The object ID in the error 602 message corresponds to the view object. SQL Server looks for the table object owned by its owner, when it should in fact be looking for the view.

WORKAROUND

Use qualifiers to reference the View name when declaring the cursor, as in the following example:

   [[database.]owner.]view_name

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server versions 6.0 and 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Keywords : kbprg SSrvTran_SQL kbbug6.00 kbbug6.50
Version : 6.0 6.5
Platform : WINDOWS
Issue type : kbbug


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