Created
December 11, 2025 16:54
-
-
Save MarkPryceMaherMSFT/ceb3d73af8455cef335a0b001475b7b7 to your computer and use it in GitHub Desktop.
query to look at extended events
This file contains hidden or 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 | |
| X.event_xml.value('(event/@name)[1]', 'varchar(50)') AS EventName, | |
| X.event_xml.value('(event/action[@name="sql_text"]/value)[1]', 'nvarchar(max)') AS SQLText, | |
| X.event_xml.value('(event/action[@name="database_name"]/value)[1]', 'varchar(128)') AS DatabaseName, | |
| X.event_xml.value('(event/action[@name="username"]/value)[1]', 'varchar(128)') AS UserName, | |
| X.event_xml.value('(event/@timestamp)[1]', 'datetime') AS EventTime | |
| FROM sys.fn_xe_file_target_read_file('C:\XE\MonitorTableQueries*.xel', NULL, NULL, NULL) AS F | |
| CROSS APPLY (SELECT CAST(F.event_data AS XML)) AS X(event_xml) | |
| ORDER BY EventTime DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment