Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Job status

Author  Topic 

carumuga
Posting Yak Master

174 Posts

Posted - 2009-11-25 : 06:09:36
Hi,

Can anyone pass me the query to know the status of the job, whether its failure or success i.e with out using the Log File Viewer.
I could able to query using sp_help_job @jobname = 'xyz' but that represent only the current status (running, idle, suspended, retry and so on) but not the success or failure.

Thanks in advance.

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-11-25 : 07:26:12
last_run_outcome int
Outcome of the job the last time it ran:
0 = Failed
1 = Succeeded
3 = Canceled
5 = Unknown
http://msdn.microsoft.com/en-us/library/ms186722(SQL.90).aspx


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

carumuga
Posting Yak Master

174 Posts

Posted - 2009-11-25 : 22:03:47
Yep, Its there. Thanks.
Go to Top of Page
   

- Advertisement -