Branches to a labeled statement.
label:
GOTO label
declare @count smallint select @count = 1 restart: print 'yes' select @count = @count + 1 while @count <=4 goto restart
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.
SQL—ISO/ANSI SQL compliant.
Sybase—Adaptive Server Enterprise supports the GOTO statement.
None