Sql-server – Extended Event definition information for a stopped session

extended-eventssql serversql server 2014

I am trying to get configuration information, via T-SQL, about existing, stopped extended-event sessions. If the session is started, then the sys.dm_xe_session_object_columns DMV gives me exactly what I'm looking for. Is that information available somewhere for stopped sessions?

Best Answer

Extended event catalog views fall under both sys.dm_xe* and sys.server_event_* views. The "active" or "running" event sessions have information stored in sys.dm_xe* (also global package metadata) views and overall server defined metadata stored in sys.server_event_* views regardless of state.

Specifically since the question was about information on extended event sessions that aren't currently running, the metadata for that still exists and the basics of it can be found in sys.server_event_sessions catalog view. Joining this with other catalog views such as sys.server_event_session_events, sys.server_event_session_actions, and sys.server_event_session_targets (to name a few) can return most of the information that should be needed.