Using SQL Server Extended Events
SQL Server Extended Events provide Data Definition Language (DDL) statements for creating and modifying an Extended Events session. In addition, there are dynamic management views and catalog views that you can use to obtain session data and metadata.
You can use Transact-SQL statements to run the views that are provided to obtain the information that you need from every extended events session that you create.
You can use SQL Server Management Studio to create and execute the code samples that are provided. For more information, see Using Object Explorer.
DDL Statements
Use the DDL statements described in the following table to create, change, and drop an Extended Events session.
Name |
Description |
---|---|
Creates an extended event session object that identifies the source of the events, the event session targets, and the event session parameters. |
|
Starts or stops an event session or changes an event session configuration. |
|
Drops an event session. |
Catalog Views
Use the catalog views described in the following table to obtain the metadata that is created when you create an event session.
Name |
Description |
---|---|
Lists all event session definitions. |
|
Returns a row for each action on each event of an event session. |
|
Returns a row for each event in an event session. |
|
Returns a row for each customizable column that was explicitly set on events and targets. |
|
Returns a row for each event target for an event session. |
Dynamic Management Views
You use the dynamic management views described in the following table to obtain session metadata and session data. The metadata is obtained from the catalog views, and the session data is created when you start and run an event session.
Note
These views do not contain session data until a session starts.
Name |
Description |
---|---|
Returns information about session dispatcher pools. |
|
Returns a row for each object that is exposed by an event package. |
|
Returns the schema information for all the objects. |
|
Lists all the packages registered with the extended events engine. |
|
Returns information about an active extended events session. |
|
Returns information about session targets. |
|
Returns information about session events. |
|
Returns information about event session actions. |
|
Provides a mapping of internal numeric keys to human-readable text. |
|
Shows the configuration values for objects that are bound to a session. |