Launch week: the Season Pass & Fundamentals Week are 50% off — ends in 21d 02h 19mSee the sale

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:

How to Create Deadlocks and Troubleshoot Them with sp_BlitzLock

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.

Free, 3× a week

Get my new posts by email

Three posts a week, plus a Monday roundup of the best database news from around the web.

5 comments

  1. 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.

  2. 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

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

  4. Hi Brent! Thank you very much for your information.
    I want to say to you troubleshooting deadlock is very hard.
    For example when XEvents only shows two select statements in the XML information, How can the root of the problem be found?

Leave a comment

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