BUG: Problems with Server Cursors on a Stored Procedure

Last reviewed: October 20, 1997
Article ID: Q175126
The information in this article applies to:
  • Microsoft SQL Server version 6.5
BUG #: 17338 (6.5)

SYMPTOMS

Running a server cursor on a stored procedure may cause SQL Server to stop responding to all clients if all of the following conditions are true:

  • The cursor type is either KEYSET or INSENSITIVE.
  • Sp_recompile was run on a table that the stored procedure references.
  • Blocking exists on the system tables of tempdb.
  • Another stored procedure that uses worktables is running simultaneously.

WORKAROUND

To work around this problem, do any of the following:

  • Do not use sp_recompile on the dependent table.
  • Change the cursor type to DYNAMIC or FORWARD-ONLY.
  • Create the stored procedure that is run by the cursor with the WITH RECOMPILE option.
  • Run SQL Server with trace flag 7502.

STATUS

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

MORE INFORMATION

To determine the type of cursor being used, see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q156489
   TITLE     : INF: Overview of SQL Server, ODBC, and DB-Library Cursors

To determine if your query uses a worktable, see the "Worktable n" topic in SQL Server Books Online. You can find this topic in the Administrator's Companion 6.0 under Part 8, "Troubleshooting" in Chapter 23, "Understanding SHOWPLAN Output."

Additionally, running sp_recompile is not necessary, but instead a change to the schema_ver column of the sysobjects system table can cause this problem. The following system stored procedures also modify the schema_ver column: sp_bindefault, sp_bindrule, sp_rename, sp_unbindefault, and sp_unbindrule.


Additional query words: responsive spinlock rdo keyset work table
Keywords : kbbug6.50 SSrvGPF 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: October 20, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.