How to Create Deadlocks and Troubleshoot Them

Watch in awe and wonder as I create a deadlock, then use sp_BlitzLock after the fact to show you which queries and tables were involved:

Here are the scripts to run in the left hand window:

And here are the right hand window commands:

sp_BlitzLock is available in our free First Responder Kit. If you run into questions on it, ask away in the #BrentOzarUnlimited channel of Slack.

To learn more about locking, blocking, and concurrency, join Kalen Delaney’s half-day online class next month.

Previous Post
Quick Tips For Debugging Large Stored Procedures
Next Post
Stuff People Tell Me Is The Default

3 Comments. Leave new

  • Thanks for the short and helpful video on this stored procedure I had not used yet. I have a database for a 3rd party application that gets deadlocks frequently. The vendor says to ignore them but now I have a tool to see them and it is quite interesting.

  • alen teplitsky
    May 22, 2018 8:54 am

    i’ve seen this happen a lot on a server that was used by OLTP and reporting. Several hundred applications total with a few core tables

  • I wish developers would use something like this, Rather than thinking that the “database” is deadlocking.