x

Trigger a mail when SQL job stuck/hung

Hello,

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

mehta.parth09
1 1 1 2

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 ♦♦
41.8k 20 50 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

By RSS:

Answers

Answers and Comments

SQL Server Central

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

Topics:

x231
x149
x102
x8
x5

asked: Sep 15, 2016 at 09:23 AM

Seen: 133 times

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

Copyright 2017 Redgate Software. Privacy Policy