BUG: Server Side Cursor Called Through RPC Can Cause Error 925

Last reviewed: May 2, 1997
Article ID: Q149245

The information in this article applies to:
  • Microsoft SQL Server, version 6.0
BUG#: 13855 (6.00)

SYMPTOMS

If a server-side cursor is opened through RPC calls from a ODBC or DB- Library application with ROWSET_SIZE set to greater than 1, the select statement references tables from the master database, and when master is not the current database, it can cause a stack overflow on SQL Server if the cursor is to be opened, fetched, and closed many times. (Note: This only happens to master, it does not apply to other cross-db references.)

The following error message can be seen on both the client side and the SQL server errorlog repeatedly:

   Msg 925, Level 19, State 1
   Maximum number of used databases for each query has been exceeded. The
   maximum allowed is 8.

WORKAROUND

  1. Do not reference the table name with master.dbo from other databases, you can always 'use master' first.

  2. Do not use ROWSET_SIZE > 1 when the cursor is opened through an ODBC or DBLib application.

Note: Workaround #2 would not work for VB/RDO applications, because OpenResultSet would automatically call SQLSetStmtOption with SQL_ROWSET_SIZE set to 100. So, workaround #1 would be the only choice for RDO applications.

STATUS

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


Additional query words: sql6
Keywords : kbbug6.00 kbprg SSrvProg
Version : 6.0
Platform : WINDOWS


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