View Full Version : What should be used to exit out of the procedure in a IF statement


Hapr1
01-16-2008, 10:07 AM
Hi,
I have an IF statement
Where I compare three variables
If [@calendar_ID1]<>[@calendar_ID2] OR [@calendar_ID1]<>[@calendar_ID3] ELSE

Else,I want to exit out of the Stored procedure..
What should I use.
GOTO END is not working..
Can't use EXIT

Thanks...

rainman89
01-16-2008, 10:07 AM
how about

exit sub

or

end if

tehNellie
01-17-2008, 02:07 AM
If you want to quit the SP, try using RETURN. You can optionally return a code to your calling code as well using RETURN <integer>