Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Enterprise
Expertise: Intermediate
Jul 29, 1999



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Return the Results of a T-SQL Procedure Execution

The RETURN keyword lets you exit from a T-SQL batch or stored procedure. You can specify an optional integer variable with RETURN to pass a status value to the calling procedure, which can evaluate the return code and perform different actions depending on the results of the T-SQL batch or stored procedure.

RETURN @return_code

If no value is specified in RETURN statement, Microsoft SQL Server returns one of the reserved numbers (0 through -99). A 0 means that the stored procedure completed successfully. A negative number indicates an error condition. However, presently only numbers -1 through -14 are being used.

Jai Bardhan
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date