1

What do I need to do in order to execute a step in a SQL Server 2012 agent job that returns a bit value back? Basically, I want to fail the job or pass to the next step based on the results from the execution of the stored proc.

1
  • Can you define "the results"? Do you mean whether it returns an error, or returns a specific return value, or outputs a specific output parameter value, or returns a specific resultset? Commented May 15, 2015 at 21:16

1 Answer 1

1

Evaluate the result from the proc (with an IF statement) and then if you want it to fail the job execute a THROW command. See this article.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.