Transact-SQL Cursor Syntax
A number of commands and functions relate to cursors. Table 14.2 summarizes them. The following subsections cover these commands in more detail.
Command or Function | Purpose |
---|---|
DECLARE CURSOR | Defines a cursor |
OPEN | Opens a cursor so that data may be retrieved from it |
FETCH | Fetches a single row from the cursor |
CLOSE | Closes the cursor, leaving intact the internal structures that service it |
DEALLOCATE | Frees the cursor's internal structures |
@@CURSOR_ROWS | Returns the number of rows exposed by the cursor |
@@FETCH_STATUS | Indicates the success or failure of the last FETCH |
CURSOR_STATUS | Reports status information for cursors and cursor variables |
DECLARE CURSOR
DECLARE CURSOR defines cursors. There ...
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.