Extended Events
functionalList Extended Events sessions with running state and per-session detail; start and stop are script-first.
Two grids side by side: the left lists the sessions with their startup state and whether
each is currently running; select one and Show Events & Targets
fills the right grid with that session's events and targets. Starting and stopping a
session is script-first: Script Start and Script Stop
open the exact ALTER EVENT SESSION … STATE = START|STOP statement in a tab
for review rather than firing from the dialog - the footer says as much.
sys.database_event_sessions). Opened from the command palette, it lists the instance's server-scoped sessions, and on Azure SQL Database, which only has database-scoped sessions, it falls back to those automatically.
Opening it
- For one database: right-click the database in the explorer and choose Tools › Extended Events.... SQLly makes that database active first. The dialog title ends in (database scope).
- For the whole instance: run Extended Events... from the command palette. The title ends in (server scope). If the server-scoped catalog cannot be read, as on Azure SQL Database - the pane retries in database scope and the title says so.
Checking a session and stopping it
Say a colleague left a tracing session running and you want to confirm what it captures before turning it off:
- Open Extended Events. The left grid lists every session by name with
startup_state(whether it starts with the server) andis_running(1when it is active right now). - Select the session's row and press Show Events & Targets. The right
grid, headed Events and targets - <session>, lists
event_nameandtarget_namepairs, such assql_batch_completedwritten to anevent_filetarget. - Press Script Stop. The dialog closes and a query tab opens with the statement, which you review and run yourself:
ALTER EVENT SESSION [long_running_queries] ON SERVER STATE = STOP;
From a database the statement says ON DATABASE instead.
Script Start produces the same statement with STATE = START.
Session names are bracket-quoted with any ] doubled, so unusual names are safe.
Buttons
| Button | What it does |
|---|---|
| Refresh | Re-reads the session list and clears the detail grid. |
| Show Events & Targets | Loads the selected session's events and targets into the right grid. |
| Script Start / Script Stop | Opens the ALTER EVENT SESSION statement for the selected session in a new query tab. Nothing runs from the dialog. |
With no row selected, the actions tell you to select a session first rather than guessing.
Permissions and limits
- Reading Extended Events metadata needs
VIEW SERVER STATE, orVIEW DATABASE STATEon Azure SQL. If the list cannot be read, the pane shows the server's error with that reminder. - The pane lists sessions and their configuration; it does not create sessions or read
captured event data. Write
CREATE EVENT SESSIONin a query tab, and read targets with the usual functions such assys.fn_xe_file_target_read_file.
SQL Server family, Extended Events is a SQL Server feature. On other engines the menu item says so; on ClickHouse it points you at system.query_log and system.trace_log, which Query Insights already reads.