sys.dm_xe_session_events (Transact-SQL)
Applies to: SQL Server Azure SQL Managed Instance
Returns information about events for active server-scoped sessions. Events are discrete execution points. Predicates can be applied to events to stop them from firing if the event does not contain the required information.
Azure SQL Database supports only database-scoped sessions. See sys.dm_xe_database_session_events.
Column name | Data type | Description |
---|---|---|
event_session_address | varbinary(8) | The memory address of the event session. Is not nullable. |
event_name | nvarchar(256) | The name of the event that an action is bound to. Is not nullable. |
event_package_guid | uniqueidentifier | The GUID for the package containing the event. Is not nullable. |
event_predicate | nvarchar(3072) | An XML representation of the predicate tree that is applied to the event. Is nullable. |
event_fire_count | bigint | The number of times the event has fired (was published) since the session was started. Is not nullable. Applies to SQL Server 2022 (16.x) and later. |
event_fire_average_time | bigint | The average time taken to publish the event, in microseconds. Is not nullable. Applies to SQL Server 2022 (16.x) and later. |
event_fire_min_time | bigint | The minimum time taken to publish the event, in microseconds. Is not nullable. Applies to SQL Server 2022 (16.x) and later. |
event_fire_max_time | bigint | The maximum time taken to publish the event, in microseconds. Is not nullable. Applies to SQL Server 2022 (16.x) and later. |
Note
The event_fire_count
and event_fire_average_time
columns are populated only when trace flag 9708 is enabled.
Permissions
Requires VIEW SERVER STATE permission on the server.
Permissions for SQL Server 2022 and later
Requires VIEW SERVER PERFORMANCE STATE permission on the server.
Relationship cardinalities
From | To | Relationship |
---|---|---|
sys.dm_xe_session_events.event_session_address | sys.dm_xe_sessions.address | Many-to-one |
sys.dm_xe_session_events.event_package_guid, sys.dm_xe_session_events.event_name |
sys.dm_xe_objects.name, sys.dm_xe_objects.package_guid |
Many-to-one |
Next steps
Learn more about related concepts in the following articles: