|
Home > Archive > MS SQL Server > June 2005 > Is there a way to check the status of a job?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Is there a way to check the status of a job?
|
|
| Chris Umbaugh 2005-06-20, 7:23 am |
| I have a job that will occasionally run out of control (call it 'job_one').
I would like to find a way to have another job ('job_two') run at a set time
(after 'job_one' should have been finished) scheduled to query the status of
'job_one'. What would be even better is to be able to tell what step
'job_one' is currently executing. If 'job_two' finds that 'job_one' is still
running, it would fire off an alert indicating that 'job_one' has not yet
ended on success and that it is currently executing Step_X.
Any ideas out there? Any help would be appreciated greatly.
Thank you,
--
Chris Umbaugh
http://www.GroundedCoffeeHouse.com
http://www.umbaugh.net
419-666-3318
419-666-3393(fax)
| |
| Uri Dimant 2005-06-20, 7:23 am |
| Chris
There are some system stored procedures that begin with sp_help_job......
,please refer to the BOL
"Chris Umbaugh" <chrisumbaugh@toast.net> wrote in message
news:evZ90$YdFHA.3396@TK2MSFTNGP10.phx.gbl...
> I have a job that will occasionally run out of control (call it
'job_one').
> I would like to find a way to have another job ('job_two') run at a set
time
> (after 'job_one' should have been finished) scheduled to query the status
of
> 'job_one'. What would be even better is to be able to tell what step
> 'job_one' is currently executing. If 'job_two' finds that 'job_one' is
still
> running, it would fire off an alert indicating that 'job_one' has not yet
> ended on success and that it is currently executing Step_X.
>
> Any ideas out there? Any help would be appreciated greatly.
> Thank you,
> --
> Chris Umbaugh
> http://www.GroundedCoffeeHouse.com
> http://www.umbaugh.net
> 419-666-3318
> 419-666-3393(fax)
>
>
| |
| Omri Bahat 2005-06-20, 11:23 am |
| Chris,
1. You can find a script that checks the status of jobs in
http://education.sqlfarms.com/ShowPost.aspx?PostID=58
2. If you wish to get different results than those provided by the script,
you can use either
sp_help_job (recommended),
or the undocumented stored procedue
xp_sqlagent_enum_job
s (less recommended since it is not documented, however
there is a lot of info about it online).
Omri.
---------------------------------
Omri Bahat
SQL Farms Solutions
www.sqlfarms.com
|
|
|
|
|