Trigger a mail when SQL job stuck/hung


Is there any script in SQL server which trigger a mail notification when SQL job or any step in the job gets stuck/hung? Like we can define threshold of 60 minute for each step of job and when it exceed so mail notification should send to DBAs to check. Please help me to get this done.

more ▼

asked Sep 15, 2016 at 09:23 AM in Default

avatar image

1 1 1 4

you'll probably need a separate job (or scheduled task in the OS) to check job duration and send the appropriate alert if the job or step has exceeded a certain threshold and is still running

Sep 19, 2016 at 11:24 PM KenJ
(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

Some monitoring tools will also do this for you... cough Redgate SQL Monitor, for example cough.

Or you could look at the article "SQL Overview V - Monitoring long-running jobs" from David Bird's series on SSC.

more ▼

answered Sep 20, 2016 at 11:09 AM

avatar image

ThomasRushton ♦♦
42.2k 20 57 53

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Sep 15, 2016 at 09:23 AM

Seen: 220 times

Last Updated: Sep 20, 2016 at 11:09 AM

Copyright 2018 Redgate Software. Privacy Policy