Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RAISERROR within SQLServerAgent job

Status
Not open for further replies.

Andel

Programmer
Feb 15, 2001
366
US
Hello folks,

I'm trying to use RAISERROR on my stored proc to log an error message to the event log. This is fine. The problem is, when I use SQLServerAgent to run the stored proc, the sqlagentjob reports failure everytime. How can I use the raiserror command and have the sqlagent job reports success?

Here's a sample (part) of the stored proc.

Code:
raiserror('Test Error Message', 16,1) with log




 
ok, but will it still execute the raiserror if app_name() not like 'SQLAgent - TSQL JobStep%'?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top