Microsoft KB Archive/243382

= PRB: Select @@Version Not Working on Dynamic Cursors =

Article ID: 243382

Article Last Modified on 10/17/2003

-

APPLIES TO


 * Microsoft OLE DB Provider for SQL Server 7.0
 * Microsoft OLE DB Provider for SQL Server 7.01
 * Microsoft ActiveX Data Objects 1.0
 * Microsoft ActiveX Data Objects 2.0
 * Microsoft ActiveX Data Objects 2.1
 * Microsoft ActiveX Data Objects 2.5
 * Microsoft ActiveX Data Objects 2.6

-



This article was previously published under Q243382



SYMPTOMS
If a SQL Server FAST_FORWARD cursor or any dynamic cursor is specified, a SELECT * FROM ... command runs properly, but a SELECT @@Version (as well as other selects) appears to hang.



CAUSE
This is by design. SQL Server attempts to create a static cursor whenever a select is issued that is not based on table data. If you have specified a dynamic cursor, SQL Server will fail to create the cursor, and return a Low priority message to that effect. OLE DB will repeat the order to create a dynamic cursor, SQL Server will fail again, and this cycle will be repeated until the connection times out.



RESOLUTION
The fix for this problem is to specify a static cursor when doing this type of SELECT. ODBC has internal code to downgrade the cursor if a dynamic cursor is requested and the server can't create it. OLE DB does not.



STATUS
This behavior is by design.

Keywords: kbdatabase kbprb KB243382

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.