Link to home
Start Free TrialLog in
Avatar of Master_Blaster
Master_Blaster

asked on

How to capture deadlock information

Avatar of sachiek
sachiek
Flag of Singapore image

Which version of SQL svr are u using? 6.5x or 7.x or 2k?


Sachi
Avatar of Master_Blaster
Master_Blaster

ASKER

SQL Server v.7.0
Deadlock information is written in SQL error log. It does not happen often.

 
Avatar of Guy Hengel [angelIII / a3]
Deadlocks should be avoided as much as possible...
If you run already into deadlocks, you must review your code!

As ZhongYu indicates, deadlocks are written in the SQL error log. Now to debug deadlocks, you need to check the locks on the objects, and locate the code that issues these locks.

Cheers
Fire up SQL Profiler. Start a new trace. From the 'Events' tab, select 'Lock: Deadlock' and 'Lock: Deadlock chain' (under the heading 'Locks') and add them to the selected events. Let it run for a while...
Are the Trace Deadlocks not avaible since SQL 2000?
not sure...
ASKER CERTIFIED SOLUTION
Avatar of Jeremy_D
Jeremy_D

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Set on the trace flags.
I think it's 1204, 1205 - you shold be able to find it in bol, this will give info about the instructions involved in the deadlocks.
Master_Blaster:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept Jeremy_D's comment as answer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Dheeraj Jain
EE Cleanup Volunteer