Undocumented SQL Server 7.0 System Tables

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
2 = GLOBAL

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)
2 = Keyset
3 = Dynamic
4 = Fast Forward

concurrency

tinyint

1 = Read-only
2 = Scroll locks
3 = Optimistic

scrollable

tinyint

0 = Forward-only
1 = Scrollable

open_status

tinyint

0 = Closed
1 = Open

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.
-1 = Fetch failed or is beyond the bounds of the
cursor.
-2 = The requested row is missing.
-9 = There has been no fetch on the cursor.

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:
0 = No operations have been performed on the cursor.

1 = OPEN
2 = FETCH
3 = INSERT
4 = UPDATE
5 = DELETE
6 = CLOSE
7 = DEALLOCATE

Continues…

Leave a comment

Your email address will not be published.