Getting Off Of Profiler, A Twelve-Step Program

Wayne Sheffield has a blast from the past, repeating an old T-SQL Tuesday to show how to use Extended Events:

Now that you have this XE session scripted out, it can be easily installed on multiple servers. If you encounter a deadlock problem, you can easily start the XE session and let it run to trap your deadlocks. They will be persisted to a file dedicated for the deadlocks. You can use my Deadlock Shredder script at to read the deadlocks from the file and shred the deadlock XML into a tabular output.

Note that the default system_health XE session also captures deadlocks. I like to have a dedicated session for just deadlocks. As lightweight as XE is, sometimes it may benefit a server to turn off the system_health session. Additionally, Jonathan Kehayias has a script that will take a running trace and completely script out an XE session for it. This script can be found at Even though this script is available, I like to figure things out for myself so that I can learn what is actually going on.

Extended Events are extremely useful for administrators, typically with a fraction of the overhead cost of  server-side (much less Profiler) traces.

Related Posts

Data-Driven Fill Factors

Tracy Boggiano has an Extended Event and a procedure to track page splits and then modify index-level fill factors accordingly: So what is the solution?  Well it really depends.  But the solution I wrote walks you through Setting the default fill factor Tracking page splits Lowering the fill factor Read on to learn more.

Read More

How Long Was That Event?

Taiob Ali shows that some extended event times are in milliseconds, some are in microseconds, and some are in unknownaseconds: There was a question in titled “module_end extended events duration in microseconds?” that I answered and it was Microsecond in that instance. Later on I questioned myself if the duration is always in Microseconds for extended […]

Read More


April 2017
« Mar May »