Configuring Cursors

In addition to configuring cursors through declaration options, Transact-SQL also provides commands and configuration options that can modify cursor behavior as well. The sp_configure and sp_dboption procedures and the SET command can be used to configure how cursors are created and the way they behave once created.

Asynchronous Cursors

By default, SQL Server generates all keysets synchronously—that is, the call to OPEN doesn't return until the cursor's result set has been fully materialized. This may not be optimal for large data sets, and you can change it via the sp_configure 'cursor threshold' configuration option (cursor threshold is an advanced option; enable advanced options via sp_configure 'show advanced options' ...

Get Guru's Guide to SQL Server Architecture and Internals, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.