Capturing deadlocks in Sqlserver 2005 and 2008 version

Hi

is there any way  to capture deadlocks in sqlserver 2005/2008 without using sql server profiler?

Thx
Naren
knaren1975Asked:
Who is Participating?
 
Ramesh Babu VavillaConnect With a Mentor Commented:
just enable
dbcc traceon (3905)
dbcc traceon(1205)

this writes the query which caused deadlock
, you can read the query by using
xp_readerrorlog
0
 
waldorf71Commented:
Yes. This article shows how to log for both errors and procedure usage:

http://www.mssqltips.com/sqlservertip/2003/simple-process-to-track-and-log-sql-server-stored-procedure-use/

Or you could roll your own based on this approach to just trap and log the deadlocks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.