Groups | Blog | Home
all groups > sql server (alternate) > january 2004 >

sql server (alternate) : sysjobhistory in SQL 2000 Server


Alexey.Aksyonenko NO[at]SPAM coanetwork.com
1/13/2004 3:25:47 PM
I see a lot of posts saying that to check if a job is currently
executing one needs to look at run_status for the job in the
sysjobhistory table in msdb catalog. I also see the possible values
of that column in the help files. What gets me is that even when I
know my job is executing (according to MMC), no record in the
sysjobhistory has the run_status of 4 (In Progress). Why is that? Is
sql NO[at]SPAM hayes.ch
1/14/2004 4:21:35 AM
[quoted text, click to view]

This looks like it may be a case of misleading documentation - there
is no entry in sysjobhistory until the job has completed (or failed,
or been cancelled). Enterprise Manager uses sp_help_job to get the
information, and that doesn't seem to use the sysjobhistory table at
all (it calls an extended proc to get the current job status, rather
than querying a table).

So I suspect that the information about status 4 is inaccurate in one
way or another (out of date, reserved for future use etc.), although I
may be wrong. In any case, you should probably use sp_help_job or the
SQLDMO Job object.

Alexey Aksyonenko
1/14/2004 3:49:21 PM
Thank you Simon, I appreciate the help. It is pretty confusing when the
documentation describes a status that does not exist. Thanks again

Alexey Aksyonenko
MCDBA, SQL Server 2000

*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button