Profiler: Deadlock Graph Event

on May 23, 2009

Until recently I’d never used the deadlock graph event in Profiler. I’ve been pretty lucky and haven’t had to troubleshoot deadlocks much until now. The deadlock graph turns out to be quite nice!

When  you add this event, it uses the TextData column to describe the deadlock in XML. You can copy the contents and parse them, or just read through it to see details on the transactions involved in the deadlock. Profiler also displays a graphical picture of the deadlock. I find the picture is helpful mostly when going through the XML itself, but the whole thing is pretty great.

The XML itself looks to be about the same as you get from trace flag 1222 in the SQL log, but you get the picture and the context of the other events you are profiling in sequence as well.

Note: the deadlock graph won’t work when you are applying certain filters in SQL 2005: See Kalen Delaney’s Post

Here is a sample look at how profiler displayed one of our deadlocks:

DeadlockGraph