GOTO Statement [T-SQL]

Branches to a labeled statement.

Syntax

label:
GOTO label

Examples

Usage

Any statement in a Transact-SQL procedure or batch can be labeled. The label name is a valid identifier followed by a colon. In the GOTO statement, the colon is not used.

Standards

  • SQL—ISO/ANSI SQL compliant.

  • Sybase—Adaptive Server Enterprise supports the GOTO statement.

Permissions

None