Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
分支到带标签的语句。
label : GOTO label
Transact-SQL 过程、触发器或批处理中的任何语句都可以带标签。标签名是一个有效标识符后跟一个冒号。在 GOTO 语句中不使用冒号。
无。
SQL/2008 服务商扩充。
以下 Transact-SQL 批处理在数据库服务器消息窗口中输出四次消息 "yes":
DECLARE @count SMALLINT SELECT @count = 1 restart: PRINT 'yes' SELECT @count = @count + 1 WHILE @count <=4 GOTO restart