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.
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.























