Is there a way to send an email alert if a dts job runs
for more than a specific time. For example, I want to
send an alert if a job runs for more than 2 minutes.As the first step of your DTS job you could start another job that simply
waits 2 minutes (waitfor delay '00:02:00') and then checks the execution
status of the DTS job (you could use sp_help_job). It could then alert if
the job was still running (assuming the DTS job wouldn't start again before
the monitor finished). I'm sure there's a slicker way but that would be
relatively simple and robust
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Tim Savery" <Tim.Savery@.mbna.com> wrote in message
news:05a701c3a2df$b7115900$a001280a@.phx.gbl...
Is there a way to send an email alert if a dts job runs
for more than a specific time. For example, I want to
send an alert if a job runs for more than 2 minutes.|||To be sure whether the job is still in the current execution, you can
execute msdb..sp_help_job before the wait, and then check execute
sp_help_job and check last_run_date and last_run_time. If the job has been
restarted, these two values would have been changed.
--
Linchi Shea
linchi_shea@.NOSPAMml.com
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:eiBPqZxoDHA.360@.TK2MSFTNGP12.phx.gbl...
> As the first step of your DTS job you could start another job that simply
> waits 2 minutes (waitfor delay '00:02:00') and then checks the execution
> status of the DTS job (you could use sp_help_job). It could then alert if
> the job was still running (assuming the DTS job wouldn't start again
before
> the monitor finished). I'm sure there's a slicker way but that would be
> relatively simple and robust
> --
> HTH
> Jasper Smith (SQL Server MVP)
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "Tim Savery" <Tim.Savery@.mbna.com> wrote in message
> news:05a701c3a2df$b7115900$a001280a@.phx.gbl...
> Is there a way to send an email alert if a dts job runs
> for more than a specific time. For example, I want to
> send an alert if a job runs for more than 2 minutes.
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment