Types of Cursors

SQL Server 2000 supports four types of cursors:

  • Forward-only cursors can retrieve data from the first to the last row, without any other navigation capabilities.

  • Static cursors provide a snapshot of the data to navigate without being affected by other connections.

  • Dynamic cursors retrieve a dynamic result set that sees modifications to the data made from outside the cursor.

  • Keyset-driven cursors create a fixed set of rows to navigate.

Static cursors use more storage space than dynamic or keyset-driven, but SQL Server uses fewer resources to navigate the data after their creation. Static cursors provide a fixed set of data that does not detect changes made by other connections.

Dynamic cursors use little storage space, but SQL Server ...

Get Microsoft® SQL Server™ 2000 Programming by Example 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.