PRB: Select @@Version Not Working on Dynamic Cursors

ID: Q243382


The information in this article applies to:
  • Microsoft OLE DB Provider for SQL Server, versions 7.0, 7.01


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.

Additional query words:

Keywords : kbDatabase kbSQLServ kbGrpVCDB kbDSupport
Version : WINDOWS:7.0,7.01
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: December 2, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.