syscursorrefs |
Contains one row for each server cursor. This table is stored in the master database and contains the cursor name, cursor scope (local or global) and cursor handler. The syscursorrefs table is used by the sp_describe_cursor, sp_cursor_list sp_describe_cursor_columns, and the sp_describe_cursor_tables system stored procedures to get cursor name, cursor scope, and cursor handler.
Column name |
Data type |
Description |
reference_name |
sysname, nullable |
Name used to refer to the cursor. |
cursor_scope |
tinyint |
1 = LOCAL |
cursor_handl |
int |
A unique value for the cursor within the scope of the server. |
syscursors |
Contains the attributes of a server cursor. This table is stored in the master database. The syscursors table is used by sp_describe_cursor system stored procedures to report the attributes of a server cursor and the sp_cursor_list system stored procedures to report the attributes of server cursors currently open for the connection.
Column name |
Data type |
Description |
cursor_handle |
int |
A unique value for the cursor within the scope of the server. |
cursor_name |
sysname, nullable |
Name of the cursor. |
status |
int |
Same values as reported by the CURSOR_STATUS system function: 1 = The cursor referenced by the cursor name or variable is open. If the cursor is insensitive, static, or keyset, it has at least one row. If the cursor is dynamic, the result set has zero or more rows. 0 = The cursor referenced by the cursor name or variable is open but has no rows. Dynamic cursors never return this value. -1 = The cursor referenced by the cursor name or variable is closed. -2 = Applies only to cursor variables. There is no cursor assigned to the variable. Possibly, an OUTPUT parameter assigned a cursor to the variable, but the stored procedure closed the cursor before returning. -3 = A cursor or cursor variable with the specified name does not exist, or the cursor variable has not had a cursor allocated to it. |
model |
tinyint |
1 = Insensitive (or static) |
concurrency |
tinyint |
1 = Read-only |
scrollable |
tinyint |
0 = Forward-only |
open_status |
tinyint |
0 = Closed |
cursor_rows |
decimal(10,0) |
Number of qualifying rows in the result set. |
fetch_status |
smallint |
Status of the last fetch on this cursor. 0 = Fetch successful. |
column_count |
smallint |
Number of columns in the cursor result set. |
row_count |
decimal(10,0) |
Number of rows affected by the last operation on the cursor. |
last_operation |
tinyint |
Last operation performed on the cursor: 1 = OPEN |