Delay of cursor compilation until cursor open

In pre-11.9.2 versions of SQL Server and Adaptive Server, a cursor is optimized and compiled when it is declared. For cursors with local variables or parameters, this can result in a suboptimal query plan, since default values are used to estimate the number of rows to be returned. The problem of poor plans is most common with client cursors, sent using Open ClientTM Client-LibraryTM or Embedded SQLTM.

In version 11.9.2, query optimization is delayed until the cursor is opened. The values of the variables are known at cursor open time, and query optimization may be considerably improved.