O'Reilly logo

Microsoft® SQL Server™ 2000 Programming by Example by Carlos Eduardo Rojas, Fernando G. Guerrero

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The RETURN Statement

The RETURN statement is used to exit unconditionally from a stored procedure. In other words, if SQL Server reaches a RETURN statement when executing a stored procedure, it stops processing and returns the control to the calling application.

The RETURN statement has one parameter,the return value,which is an integer that can be used to communicate with the calling application. When creating a stored procedure, if you use a data type other than integer for the return value, SQL Server allows you to create the stored procedure, but you will get an error when it is executed.

The return value is 0 by default; therefore, if a stored procedure containsa RETURN statement without this parameter, the return value will be 0. Therefore, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required