Getting SQL Job Status

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have .NET apps that use information that is in Microsoft SQL Server and is
updated every night by SQL Server jobs. Is there a way to check the status
of a SQL Server job in C# to make sure the job was successful. I want to be
able notify users of a failure so that no one uses incorrect information.

Thank you for any assistance,
Adam
 
ACFalcon,

I'm not that familiar with jobs in SQL server, but since everything is
stored in tables in the server, perhaps you can query the system tables
themselves to check on the status?

If not, then you probably can find out the job status through the
objects exposed by the SQLDMO COM component (which you would have to use COM
interop to access).

Ahh, here we go. Check out the system stored procedure "sp_help_job".
It should give you all the information you want.

Hope this helps.
 
HI ACFalcom:

The system stored proc sp_help_jobhistory lets you query and filter
the job information.
 
Back
Top