Deadlock information can be captured in the SQL Server Error Log or by using Profiler / Server Side Trace.
How do I monitor SQL Server deadlocks?
View a graphical representation of the deadlock event
- Open the deadlock event in Event Viewer.
- On the General tab, go to the SQL Server deadlock xml report section, and then copy the text in the deadlock tag (including the start and end tag) to a text editor such as Notepad or Visual Studio Code.
- Save the file as a .
How does SQL Server handle deadlocks?
Set deadlock priorities using the SET DEADLOCK_PRIORITY session variable. If you set the deadlock priority, SQL Server kills the session with the lowest deadlock priority. Utilize the error handling using the try-catch blocks. You can trap the deadlock error and rerun the transaction in the event of a deadlock victim.