Cursors Event Category

The Cursors event classes can be used to monitor cursor operations.

Event class Description
CursorClose A cursor previously opened on a Transact-SQL statement by ODBC, OLE DB, or DB-Library is closed.
CursorExecute A cursor previously prepared on a Transact-SQL statement by ODBC, OLE DB, or DB-Library is executed. For more information, see How to prepare and execute a statement (ODBC).
CursorImplicitConversion A cursor on a Transact-SQL statement is converted by SQL Server from one type to another.

Triggered for ANSI and non-ANSI cursors.

CursorOpen A cursor is opened on a Transact-SQL statement by ODBC, OLE DB, or DB-Library.
CursorPrepare A cursor on a Transact-SQL statement is prepared for use by ODBC, OLE DB, or DB-Library. For more information, see How to prepare and execute a statement (ODBC).
CursorRecompile A cursor that is opened on a Transact-SQL statement by ODBC or DB-Library has been recompiled either directly or due to a schema change. Triggered for ANSI and non-ANSI cursors.
CursorUnprepare A prepared cursor on a Transact-SQL statement is unprepared (deleted) by ODBC, OLE DB, or DB-Library.

By monitoring the CursorOpen, CursorExecute, and CursorImplicitConversion event classes, you can determine when a cursor is executed and what type of cursor is used. These event classes are useful to determine the actual cursor type used for an operation by SQL Server, rather than the cursor type specified by the application.

These are the event-specific data columns for the Cursors event category.

Event class Data column Description
CursorClose Event Sub Class Handle of the cursor.
CursorExecute Event Sub Class Handle of the cursor.
  Integer Data Cursor type. Values are:

1  = Keyset
2  = Dynamic
4  = Forward only
8  = Static
16 = Fast forward

  Binary Data Handle of the prepared cursor.
CursorImplicitConversion Integer Data Requested cursor type. Values are:

1  = Keyset
2  = Dynamic
4  = Forward only
8  = Static
16 = Fast forward

  Binary Data Resulting cursor type. Values are:

1  = Keyset
2  = Dynamic
4  = Forward only
8  = Static
16 = Fast forward

CursorOpen Event Sub Class Handle of the cursor.
  Integer Data Cursor type. Values are:

1  = Keyset
2  = Dynamic
4  = Forward only
8  = Static
16 = Fast forward

CursorPrepare Event Sub Class Handle of the prepared cursor.
CursorUnprepare Event Sub Class Handle of the cursor created by CursorPrepare.

See Also

Cursors

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.