CREATE EVENT SESSION
defines event session (no row flow)
What changes
- Input
- catalog
- Output or change
- catalog: event session
Syntax at a glance
CREATE EVENT SESSION event_session_name ON { SERVER | DATABASE } { <event_definition> [ , ...n ] [ <event_target_definition> [ , ...n ] ] [ WITH ( <event_session_options> [ , ...n ] ) ] } ;
Work example
An incident review needs bounded Extended Events data for a specific failure signal.
Select only required events and actions, add a predicate, set a file target limit, and name the stop condition.
Check your work A lab event is captured while file size and event volume stay within the review limit.
Open Microsoft Learn for full syntax, permissions, and details for your version.