Dave Mason shows us how you can use T-SQL to shred XML coming from extended events sessions:
Querying the data of an Extended Events session has never been easy. My XEvent sessions typically store event data in a target file, which means usingĀ sys.fn_xe_file_target_read_file. To get something of value, you need to shred the event data XML.
Doing this in T-SQL isn’t great. It’s probably better to shred in another language—F# would probably be my choice due to its type provider—and dump the results back into SQL. But if you want to stick to one language, Dave shows you how.