How to record queries which create deadlock in SQL Server 2008 r2?
-
Wednesday, June 13, 2012 10:06 PM
Hi,
I am using SQL Server 2008 r2.
I am having Deadlock problem when process usually executes a stored procedures. i want to know which specific queries are creating deadlock.
Could you please inform me any script or an easy way through which I can do it?
Thanks!
All Replies
-
Wednesday, June 13, 2012 11:53 PM
These articles could help -
http://www.simple-talk.com/sql/learn-sql-server/how-to-track-down-deadlocks-using-sql-server-2005-profiler/
http://msdn.microsoft.com/en-us/library/ms178104(SQL.105).aspxAnother one with a trace flag option. Normally such flags are not kept on for an extended on a server. Just long enough to gather the required info and then turned off.
http://www.sqlservercentral.com/articles/deadlocks/74829/
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers.
Thanks!
Aalam | Blog (http://aalamrangi.wordpress.com)- Edited by Aalam Rangi Thursday, June 14, 2012 12:00 AM Added MSDN article URL.
- Marked As Answer by Maggie LuoMicrosoft Contingent Staff, Moderator Sunday, June 24, 2012 2:53 PM
-
Monday, June 25, 2012 3:12 PM
SQL Server Profiler has a Deadlock event. Trace while the ddealock is occuring and you can view the statements involved.
Jack Vamvas sqlserver-dba.com

