Cursor Stored Procedures

SQL Server provides a number of cursor-related stored procedures with which you should familiarize yourself if you expect to work with cursors much. Table 14.3 provides a brief list of them, along with a description of each.

Each of these returns its result via a cursor output parameter, so you'll need to supply a local cursor variable in order to process them.

Table 14.3. Stored Procedures Related to Cursors
ProcedureFunction
sp_cursor_listReturns a list of the cursors and their attributes that have been opened by a connection
sp_describe_cursorLists the attributes of an individual cursor
sp_describe_cursor_columnsLists the columns (and their attributes) returned by a cursor
sp_describe_cursor_tablesReturns a list of the ...

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.