Tuesday, October 6, 2009

Deadlock Graph-Don't Filter by DBname or DBID

This is my first blog post and I was wondering what should i post and on what topic. While working on troubleshooting deadlocks I came to know about a bug in Sql Server Profiler .I thought I would post about it.


In order to troubleshoot deadlocks that were happening on the application ,I started the Sql Server Profiler trace and selected the 'Deadlock Graph' event along with other events .

The Deadlock Graph event gives us a lot of information like the statements that are involved, the type of lock, victim, spid of the deadlock process.

I also put a filter on the database id because i wanted to keep the trace at a manageable level.

But i couldn't see any deadlock events populated. Querying the sys.dm_os_waiting_tasks shows me tasks blocking each other.Then i changed the filter to database name,but the deadlock graph event did not get populated.

So When i did a search across the web i came to know that this is a bug in Profiler in Sql Server 2005.

References:
http://sqlblog.com/blogs/kalen_delaney/archive/2006/11/28/376.aspx
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=240737