GOTO Statement [T-SQL]

Branches to a labeled statement.

Quick Links:

Go to Examples

Go to Usage

Go to Standards

Go to Permissions

Syntax

label : GOTO label

Examples

(back to top)

Usage

(back to top)

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

(back to top)

  • SQL—ISO/ANSI SQL compliant.
  • SAP Sybase Database product—Adaptive Server supports the GOTO statement.

Permissions

(back to top)

None