Let me be extremely clear up front, this is not my original work. I saw this post on DBA.StackExchange.com and I wanted to share and promote it. Nice work FevziKartal.
The rest of this post is just me replicating work already done by others. I just want to see it in action.
Columns in Live Data Explorer
Back when I wrote the 2017 version of my query performance tuning book (no link, a) get the 2022 version for reasons I’m about to explain, b) this post is just about testing FevziKartal’s work, not self-promotion), I was on board with #TeamXE. Jonathan Kehayias had taken me under his wing and explained the virtues of Extended Events and I was sold. I was also grossly ignorant. I thought that the way you looked at the events in the Live Data Explorer window was like this:
You had to scroll around in the top window looking for the right row, then look at the data in the bottom window to see the details. I completely missed this little gem:
And selecting that would have shown me this:
Which would have allowed me to do this with the top half of the Live Data Explorer window, opening up all sorts of wonderful functionality:
That’s what’s going on with columns in the Live Data Explorer window. However…
What If There Are No Events?
You set up an Extended Events session. Let’s assume for our purposes, it’s tracking a particular stored procedure. You’re testing this, so you can control exactly when that procedure fires. If you immediately open the Live Data Explorer window, it’ll look something like this:
Perfectly normal. I’ve seen this probably thousands of times at this point (maybe tens of thousands). What never occurred to me is, what does the Choose Columns window look like when there are no events? I mean, I guess I assumed it was listing the columns from the Session definition or something. But no, as FevziKartal shows, you get this:
No events, no columns. It’s that simple. So the list of columns is evidently dependent on the events that have been captured.
Conclusion
Nice work FevziKartal! Please, follow the link and give them a few up-doots.
The main point is, always be on the lookout for new knowledge. I know the majority of you are way smarter than I am and know more. However, there is ALWAYS more to learn. I loved this one just because it’s so silly simple, yet, one more potential blocker to people adopting Extended Events. Let’s face it, they’re more than a bit quirky in their overall behavior. I still love ’em, but I can readily acknowledge that Extended Events can be weird.