I would suggest that you come at the problem from two perspectives.
-
Trap or Catch Deadlock Errors so that you can re-run the transaction that is chosen as the Deadlock Victim by the SQL Server database engine.
-
Find out what is causing your Deadlock Events.
You can do this in one of two ways, either run a SQL Server Profiler Trace to catch and record the Deadlock Event or you can enable some SQL Server Trace Flags that will record the details of the Deadlock Event to the SQL Server Error Log.
In the vast majority of cases, you can identify the cause of your Deadlock Events and remedy the situation through either a structural change in the database schema or a logical change to the code involved/responsible for the Deadlock Event.
For further reading take a look at:
- How to track down Deadlocks Using SQL Server Profiler
- Minimizing Deadlocks
- Detecting and Ending Deadlocks
I hope I’ve answered your question but do let me know if I can help you further in any way.