sql server - Stored Procedure Return Value to Fail SQL Job -
I have a stored procedure that is the first step in the SQL job. SP2 compares the dates of tables, if they are equal then SQL can continue the job, but if I do not need to return the price from SP, SQL is due to trigger the job in the failure of the job .
What is the best way to do this? Is it with a Writer statement or can just return a value like -99?
There is such a clear question, but I've never thought about it before.
You can use a try / hold and raiserror, whatever you want Can write error.
Usually, I only use an IF statement which returns and then moves forward with the rest code.
I think it's a matter of preference / requirement, though Either work will be completed.
Comments
Post a Comment