Contents Index GET OPTION statement [ESQL] GRANT statement

ASA SQL Reference
  SQL Statements

GOTO statement [T-SQL]


Description 

Use this statement to branch to a labeled statement.

Syntax 

label : GOTO label

Usage 

Any statement in a Transact-SQL procedure, trigger, 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.

Permissions 

None.

Side effects 

None.

Standards and compatibility 
Example 

The following Transact-SQL batch prints the message "yes" on the server window four times:

declare @count smallint
select @count = 1
restart:
   print 'yes'
   select @count = @count + 1
   while @count <=4
    goto restart

Contents Index GET OPTION statement [ESQL] GRANT statement