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)

alert on blocking chains via email

By Wesley Brown,

This is a script I use to watch for blocking chains on a server there are four variables to be set. @Duration tells it how long to run. This will be an active thread for the duration. @IntervalSec how often to poll for blocking. @maxwaittime time in miliseconds a thread that is blocked that you wish to allert on 30000 is 30 seconds. If a thread has been blocked that long alerts will start going out. @recivers, people who get the emails.

You can set it up as a job to start it will always show as executing until the duration runs out. I have it set to run every minute just in case there is a thread exit it will restart the job again.

Total article views: 1615 | Views in the last 30 days: 5
 
Related Articles
FORUM

blocking

blocking

FORUM

SQL Profiler - Can it tell you how long query was blocked for

I want to find only non-blocked long-duration queries

FORUM

OLEDB Waiting and Blocking

OLEDB Waiting and Blocking

FORUM

max worker threads

max worker threads

FORUM

SQL Server 2005 Profiler

Duration

 
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