Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Script to kill the top blocker and report what it was doing.

By integer,

This script identifies the blocking locks at the top of the blocking chain and kills them. Specifically, it reports what the top blocking spids are doing, kills them, waits three seconds and then reports on current blocking status.  If you have a situation where single connections are causing a huge blocking chain and you want to kill the absolute minimum number of spids, then this script is for you.  There is a safety valve in the script to determine the age of the blocks to kill. By default the script kills only the spids at the top of the blocking chain (Thus freeing all blockers and spids below it) if the blocker is older than 5 seconds.

Total article views: 2214 | Views in the last 30 days: 17
 
Related Articles
SCRIPT

Retrieve locking block-chain

This script utilize the DMV to quickly build the locking block-chain.

ARTICLE

Blocking Chain (SQL Spackle)

Problems with blocking processes can be easy to identify with SQL Server DMV's.

BLOG

SQLDIY: Alert On Blocking Chains

Continuing the SQLDIY monitoring project we will take a look at tracking blocking events. I actually...

SCRIPT

Blocked Users Script

This script gives you info about blocked sessions, program name, wait_type, duration and SQL text of...

FORUM

blocking

blocking

 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones