sysjobhistory in SQL 2000 Server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alexey Aksyonenko

    sysjobhistory in SQL 2000 Server

    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
    there a server-wide setting that needs to be enabled?
  • Simon Hayes

    #2
    Re: sysjobhistory in SQL 2000 Server

    Alexey.Aksyonen ko@coanetwork.c om (Alexey Aksyonenko) wrote in message news:<1449e414. 0401131525.5ea2 49d9@posting.go ogle.com>...[color=blue]
    > 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
    > there a server-wide setting that needs to be enabled?[/color]

    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.

    Simon

    Comment

    • Alexey Aksyonenko

      #3
      Re: sysjobhistory in SQL 2000 Server

      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 ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      Working...