SQL 2000 - Returning from a Stored Procedure

Posted by user70192 on Stack Overflow See other posts from Stack Overflow or by user70192
Published on 2010-04-22T13:03:13Z Indexed on 2010/04/22 13:13 UTC
Read the original article Hit count: 204

Hello,

I'm writing a stored procedure. This procedure has a case where if it is met, I want to stop executing the procedure and return -1. How do I do this? Currently, I'm trying the following:

IF @result <> 1
BEGIN
  SELECT -1                 
END

However, SELECT is not a typical "return". As you can imagine I spend most of my time in code which is why i'm looking for something like a "return".

Thank you,

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server-2000