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 2000 Forums
 SQL Server Administration (2000)
 How to save an error message into table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-01-26 : 08:14:42
irwan writes "Dear SQLTeam,
is there any way that I can save an error message that came from a failed 'scheduled job' into an existing table in a database?

I need this error report in order to send it via SMS.

TIA,
Irwan"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-01-26 : 08:16:15
These messages are already saved in the sysjobhistory table in msdb. You can query for failed jobs/steps with:

SELECT * FROM msdb..sysjobhistory WHERE run_status=0

The message column contains the error messages.
Go to Top of Page
   

- Advertisement -