SQL中的Continue和Break
时间:2021-07-01 10:21:17
帮助过:28人阅读
@Index Int = 0,
@EndIndex Int = 0
While @Index < 100
Begin
Set @EndIndex = @EndIndex + 1
Print ‘Continue 之后Index增加...‘ + Convert(
Varchar(
1000),
@Index)
If @EndIndex > 100
Begin
Print ‘防止死循环...*************************************************‘
Break
End
Continue
Set @Index =@Index + 1
End
Set @Index = 0
While @Index < 100
Begin
Print ‘Continue 之前Index增加...‘ + Convert(
Varchar(
1000),
@Index)
Set @Index =@Index + 1
Continue
End
Set @Index = 0
While @Index < 100
Begin
Print ‘Break Index...‘ + Convert(
Varchar(
1000),
@Index)
Break
End
x
SQL中的Continue和Break
标签:sql语句 varchar begin demo class 包含 nbsp logs 循环