Getting SQL Job Status

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
S

Scott Allen

HI ACFalcom:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top