Is there a way to immediately stop execution of a stored procedure that has an output parameter anytime certain criteria is met?
My situation is this (cheap SP skeleton) :
if errorcheck begin
set @outputString = 'error'
--if I hit this error, I don't need to execute anymore of the SP
end
if errorcheck2 begin
set @outputString = 'other error'
end
Basically, anytime I hit an error I'd like to stop execution of the SP and return the @outputString.
I'm thinking I can do this with multiple return statements, but I'm not sure.
<.
My situation is this (cheap SP skeleton) :
if errorcheck begin
set @outputString = 'error'
--if I hit this error, I don't need to execute anymore of the SP
end
if errorcheck2 begin
set @outputString = 'other error'
end
Basically, anytime I hit an error I'd like to stop execution of the SP and return the @outputString.
I'm thinking I can do this with multiple return statements, but I'm not sure.
<.