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.

To learn more about locking, blocking, and concurrency, check out my Mastering Query Tuning class.

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.

    Reply
  • 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

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

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.

Menu
{"cart_token":"","hash":"","cart_data":""}