devxlogo

Return the Results of a T-SQL Procedure Execution

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.

See also  Professionalism Starts in Your Inbox: Keys to Presenting Your Best Self in Email
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist