<p>I'm looking for suggestions on how to debug and chase down deadlock issues in an SQL Server 2000 database.  I've had it recommended to me to use trace flags 1024 and 3605, which I have found give me the following:</p>

<p>1024 - this trace flag returns the type of locks participating in the deadlock and the current command affected. </p>

<p>3605 - this trace flag sends trace output to the error log.</p>

<p>The specific stored procedures, tables and indexes still need to be uncovered, so the goal is to use these trace flags to do so.  And then from there I'll know better what indexes need tuning, locking hints for tuning queries, and potential sproc bugs to fix.</p>

<p>Any other suggestions or happy ending war stories on chasing down this all to common problem?</p>

[{'answer_id': 52582, 'author': 'Gulzar Nazim', 'author_id': 4337, 'author_profile': 'https://Stackoverflow.com/users/4337', 'pm_score': 2, 'selected': False, 'text': '<p>Once you know the sql statements involved, a code analysis will surely help. Some thumb rules are checking for the order in which the rows are accessed and checking for the isolation level used for the SQL statements. A profiler trace can help a lot.</p>\n\n<p>Most of the time, it is because of a reader trying to get a shared lock on a resource locked exclusively by a writer.</p>\n'}, {'answer_id': 52594, 'author': 'SQLMenace', 'author_id': 740, 'author_profile': 'https://Stackoverflow.com/users/740', 'pm_score': 3, 'selected': True, 'text': '<p>Here is the bible on deadlock troubleshooting: <a href="http://blogs.msdn.com/bartd/archive/2006/09/09/Deadlock-Troubleshooting_2C00_-Part-1.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/bartd/archive/2006/09/09/Deadlock-Troubleshooting_2C00_-Part-1.aspx</a></p>\n'}, {'answer_id': 81217, 'author': 'DiGi', 'author_id': 12042, 'author_profile': 'https://Stackoverflow.com/users/12042', 'pm_score': 2, 'selected': False, 'text': '<p>Very useful script for analyzing deadlocks: <a href="http://www.sommarskog.se/sqlutil/aba_lockinfo.html" rel="nofollow noreferrer">http://www.sommarskog.se/sqlutil/aba_lockinfo.html</a></p>\n'}]
['https://Stackoverflow.com/questions/52566', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4764/']