SQL SERVER – Blocking Tree – Identifying Blocking Chain Using sp_WhoIsActive

Spread the love

As a DBA, I often receive user requests to check server slowness. Quite often, slowness is directly linked with active blocking on the server.

I find many scripts on internet that provide partial blocking information. For example, below 2 scripts by Pinal Dave are very famous:-

But, neither of above scripts provide me full picture or flexibility to choose my own metrics.

In order to overcome this issue, I wrote my own version of Blocking Query, which is as below:-

The main benefit of above query is that it uses world famous procedure sp_WhoIsActive to collect blocking metrics with full customization of sp_WhoIsActive.

Thus, with little knowledge and learning, you we get a good grasp of blocking issue with the above query.

I hope this has been helpful. Happy Coding 🙂

One Comment

Add a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.