FIX: Error message when you call the SQLTables function against an instance of SQL Server 2005: "Invalid cursor state (0)"

Article translations Article translations
Article ID: 925227 - View products that this article applies to.
Bug #: 50000244 (SQL Hotfix)
Bug #: 482039 (SQLBUDT)
Microsoft distributes Microsoft SQL Server 2005 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2005 fix release.
Expand all | Collapse all

On This Page

SUMMARY

This article describes the following about this hotfix release:
  • The issues that are fixed by this hotfix package
  • The prerequisites for installing the hotfix package
  • Whether you must restart the computer after you install the hotfix package
  • Whether the hotfix package is replaced by any other hotfix package
  • Whether you must make any registry changes
  • The files that are contained in the hotfix package

SYMPTOMS

When you call the SQLTables function against an instance of Microsoft SQL Server 2005, you may receive an error message. The error message that you receive is based on the ODBC data source driver that you use to connect to the instance of SQL Server 2005. If you use the SQL Native Client data source driver, you receive the following error message:
szSqlState = "24000", *pfNativeError = 0, *pcbErrorMsg = 50, *ColumnNumber = -1, *RowNumber = -1 MessageText = "[Microsoft][SQL Native Client]Invalid cursor state"
If you use the ODBC SQL Server data source driver, you receive the following error message:
szSqlState = "24000", *pfNativeError = 0, *pcbErrorMsg = 55, *ColumnNumber = -1, *RowNumber = -1 MessageText = "[Microsoft][ODBC SQL Server Driver]Invalid cursor state"
This problem occurs if the following conditions are true:
  • The value that you specify in one of the following parameters of the SQLTables function contains a wildcard character:
    • CatalogName
    • SchemaName
    • TableName
    For example, one of these parameters contains an underscore (_) character or a percent (%) character.
  • You specify ODBC 3.0 for the ODBC behavior of the ODBC data source driver.
  • You call the SQLTables function on a server-side cursor.

RESOLUTION

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support
Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Prerequisites

You must have SQL Server 2005 Service Pack 1 (SP1) installed to apply this hotfix.
For more information about how to obtain SQL Server 2005 Service Pack 1, click the following article number to view the article in the Microsoft Knowledge Base:
913089 How to obtain the latest service pack for SQL Server 2005

Restart information

You do not have to restart the computer after you apply this hotfix.

Registry information

You do not have to change the registry.

Hotfix file information

This hotfix contains only those files that are required to correct the issues that this article lists. This hotfix may not contain of all the files that you must have to fully update a product to the latest build.
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.SQL Server 2005 32-bit version
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Logread.exe2005.90.2190.0398,1129-Sep-200618:25x86
Microsoft.analysisservices.adomdclient.dll9.0.2190.0543,5209-Sep-200618:25x86
Microsoft.analysisservices.deploymentengine.dll9.0.2190.0138,0169-Sep-200618:23x86
Microsoft.analysisservices.dll9.0.2190.01,215,2649-Sep-200618:24x86
Microsoft.sqlserver.mgdsqldumper.dll2005.90.2190.075,5529-Sep-200618:22x86
Microsoft.sqlserver.sqlenum.dll9.0.2190.0 908,0649-Sep-200618:24x86
Msgprox.dll2005.90.2190.0197,9209-Sep-200618:23x86
Msmdlocal.dll9.0.2190.015,610,1449-Sep-200618:24x86
Msmdredir.dll9.0.2190.0 3,990,3049-Sep-200618:24x86
Replprov.dll2005.90.2190.0547,6169-Sep-200618:25x86
Replrec.dll2005.90.2190.0782,1129-Sep-200618:24x86
Sqlaccess.dll2005.90.2190.0347,9369-Sep-200618:24x86
Sqlagent90.exe2005.90.2190.0319,2649-Sep-200618:24x86
Sqlservr.exe2005.90.2190.028,960,6009-Sep-200618:24x86
Xpstar90.dll2005.90.2190.0292,6409-Sep-200618:26x86
Xpstar90.rll2005.90.2190.0152,8649-Sep-200618:23x86
SQL Server 2005 x64-based version
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Logread.exe2005.90.2190.022,52810-Sep-20060:21x64
Microsoft.analysisservices.adomdclient.dll9.0.2190.0543,5209-Sep-200618:25x86
Microsoft.analysisservices.adomdclient.dll9.0.2190.0543,52010-Sep-20060:21x86
Microsoft.analysisservices.deploymentengine.dll9.0.2190.0138,0169-Sep-200618:23x86
Microsoft.analysisservices.dll9.0.2190.01,215,2649-Sep-200618:24x86
Microsoft.sqlserver.mgdsqldumper.dll2005.90.2190.075,5529-Sep-200618:22x86
Microsoft.sqlserver.mgdsqldumper.dll2005.90.2190.091,42410-Sep-20060:20x64
Microsoft.sqlserver.sqlenum.dll9.0.2190.0875,29610-Sep-20060:20x86
Msgprox.dll2005.90.2190.0259,36010-Sep-20060:21x64
Msmdlocal.dll9.0.2190.015,610,1449-Sep-200618:24x86
Msmdredir.dll9.0.2190.03,990,3049-Sep-200618:24x86
Replprov.dll2005.90.2190.0745,24810-Sep-20060:20x64
Replrec.dll2005.90.2190.01,008,41610-Sep-20060:20x64
Sqlaccess.dll2005.90.2190.0355,10410-Sep-20060:21x86
Sqlagent90.exe2005.90.2190.0390,94410-Sep-20060:21x64
Sqlservr.exe2005.90.2190.039,344,92810-Sep-20060:20x64
Xpstar90.dll2005.90.2190.0540,96010-Sep-20060:21x64
Xpstar90.rll2005.90.2190.0153,37610-Sep-20060:20x64
SQL Server 2005 Itanium architecture version
Collapse this tableExpand this table
File nameFile versionFile sizeDateTimePlatform
Logread.exe2005.90.2190.01,095,45610-Sep-200610:38IA-64
Microsoft.analysisservices.adomdclient.dll9.0.2190.0543,5209-Sep-200618:25x86
Microsoft.analysisservices.adomdclient.dll9.0.2190.0543,52010-Sep-200610:37x86
Microsoft.analysisservices.deploymentengine.dll9.0.2190.0138,0169-Sep-200618:23x86
Microsoft.analysisservices.dll9.0.2190.01,215,2649-Sep-200618:24x86
Microsoft.sqlserver.mgdsqldumper.dll2005.90.2190.075,5529-Sep-200618:22x86
Microsoft.sqlserver.mgdsqldumper.dll2005.90.2190.0163,10410-Sep-200610:37IA-64
Microsoft.sqlserver.sqlenum.dll9.0.2190.0875,29610-Sep-200610:38x86
Msgprox.dll2005.90.2190.0542,49610-Sep-200610:37IA-64
Msmdlocal.dll9.0.2190.048,587,04010-Sep-200610:37IA-64
Msmdredir.dll9.0.2190.06,237,47210-Sep-200610:38IA-64
Replprov.dll2005.90.2190.01,617,18410-Sep-200610:38IA-64
Replrec.dll2005.90.2190.02,141,47210-Sep-200610:38IA-64
Sqlaccess.dll2005.90.2190.0349,47210-Sep-200610:37x86
Sqlagent90.exe2005.90.2190.01,143,58410-Sep-200610:38IA-64
Sqlservr.exe2005.90.2190.072,242,97610-Sep-200610:37IA-64
Xpstar90.dll2005.90.2190.0951,07210-Sep-200610:39IA-64
Xpstar90.rll2005.90.2190.0152,35210-Sep-200610:37IA-64

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

The hotfix changes the sp_tableswc system stored procedure and the sp_ddopen;13 system stored procedure. The sp_tableswc system stored procedure has been changed to return either a result set or a cursor based on a parameter. The sp_ddopen;13 system stored procedure now calls the sp_tableswc system stored procedure that has a parameter that is set to return a cursor. Therefore, a nested INSERT… EXEC statement can be avoided.

This hotfix adds new parameters to the sp_tableswc system stored procedure. However, these new parameters have default values. Therefore, these new parameters will not cause a problem to the existing call to the sp_tableswc system stored procedure.

REFERENCES

For more information about the SQLTables function, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/ms131341.aspx
For more information about the naming schema for Microsoft SQL Server updates, click the following article number to view the article in the Microsoft Knowledge Base:
822499 New naming schema for Microsoft SQL Server software update packages

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

Properties

Article ID: 925227 - Last Review: October 8, 2011 - Revision: 2.0
APPLIES TO
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Workgroup Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Standard X64 Edition
  • Microsoft SQL Server 2005 Enterprise X64 Edition
Keywords: 
kbautohotfix kbHotfixServer kbfix kbexpertiseadvanced kbqfe KB925227

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com