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)

List long running SQL Agent Jobs

By Neil Bryan,

This script will list long running SQL agent jobs and output the results into a HTML formatted email. I have this set up as a SQL Agent job which runs on every Monday morning against  our major severs. The results are then emailed to me.

To use script a number of local variables will need to be set-up (ie email server info, search window size, duration time, etc.). Please refer to the comments in the code for further details.

Total article views: 1762 | Views in the last 30 days: 7
Related Articles

Email Pruning

Email consumes a pretty significant chunk for me. Email for my day job, email for my blog, email fro...


Update Email Trigger

Email trigger sends two emails


looping emails

sending and looping emails


Sending email using Send Email Task

Sending email using Send Email Task

long running    
sql agent    

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

Already a member? Jump in:

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