PRB: SQL Server Cursor Type May Change From Dynamic to KeysetID: Q153115
|
Under certain circumstances, on a table with few rows, a keyset cursor is created on a SELECT statement with an ORDER BY clause even when a dynamic or a server-side forward_only cursor is specified and all the rules for creating dynamic/forward_only cursors are satisfied.
Specify an explicit optimizer hint to use the unique index that you created
on the column(s) used in the ORDER BY clause of the SELECT statement.
create table test(vendor int not null , upc char(12) not null)
go
create unique index ind1 on test(upc)
go
create unique index ind2 on test(vendor)
go
insert test values(20,'ABC Vision')
go
insert test values(10,'XYZ Tech')
Select * from test (index=ind2) where vendor=20 and upc>='ABC Vision'
order by vendor
Additional query words: ODBC RDO VB MFC Database Classes
Keywords : kbprg SSrvProg
Version : 2.65.0201 6.5
Platform : WINDOWS
Issue type :
Last Reviewed: March 30, 1999