Created
October 1, 2021 16:49
-
-
Save alliwallibobali/b37d5da45ceb75f59cd59dc8131f3e9f to your computer and use it in GitHub Desktop.
You can see which SQL Server Extended Event sessions are running using the following code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
[ses].[name] AS [Session Name], | |
CASE | |
WHEN [xs].[address] IS NOT NULL THEN 'Running' | |
ELSE 'Stopped' | |
END AS [State], | |
[xs].[create_time] AS [Start Time] | |
FROM sys.server_event_sessions AS [ses] | |
left outer JOIN sys.dm_xe_sessions AS [xs] | |
ON [ses].[name] = [xs].[name] | |
ORDER BY [State], [Start Time]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment