Microsoft KB Archive/149245

{|
 * width="100%"|

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

 * }

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 : kbprogramming

Issue type :

Technology : kbSQLServSearch kbAudDeveloper kbSQLServ600