Home » Interview Q&A » Find Blocking queries in Sql Server

Find Blocking queries in Sql Server

Remove blank lines in Sql Server Script
Should we Shrink database - Sql Server

Find Blocking queries in Sql Server

Hello folks, today I will explain regarding most common problem of blocking in Sql Server. There are so many developers having same question “How can we find blocking queries in Sql Server”.

Let’s try to take an example and understand how to find blocking queries in Sql server, find below script:

Output:

Find blocking queries in Sql Server-1

Now let’s try to insert new record by using transaction and we will not close that transaction as shown below code

Same time suppose some of user trying to access same table, user will have to wait until transaction will not get completed.

Now try to find blocking query by using below script:

Output:

Find blocking queries in Sql Server-3

You could also take reference of whoIsActive script to get in depth fact findings. You can download from http://whoisactive.com/

Output:

Find blocking queries in Sql Server-4

Hope you have understood how to find blocking queries in Sql Server.

 

About

Hello friends, My self Dhruv Sheth, I have more than 6 years of Industrial experience as a Software Developer. In my career I got chance to work with asp.net, c#,Web API, JavaScript, JQuery, WPF, WCF , Windows Application, PostScript, vb.net, GhostScript etc. So I have decided to share my knowledge with everyone and finally I have come up with TechnoThirsty.




DISCLAIMER:
The content is copyrighted to technothirsty.com and may not be reproduced on other websites without permission from the owner.You may contact us using the information below.