RETURN Statement

Exits a function or procedure unconditionally, optionally providing a return value. Statements following RETURN are not executed.

Syntax

RETURN [ ( expression ) ]

Parameters

Examples

Usage

RETURN is used in procedures for Transact-SQL-compatibility, and is used to return an integer error code.

Standards

  • SQL—ISO/ANSI SQL compliant.

  • Sybase—Transact-SQL procedures use the return statement to return an integer error code.

Permissions

None

Related reference
BEGIN … END Statement
CREATE PROCEDURE Statement