Goto语句
declare@a int
select@a=100
flag1:
print@a
select@a=@a+1
while(@a<105)
goto flag1 //当a<105时,返回到flag1的地方,继续执行
print '-----'
print @a
局部临时表:
create table #temp_stu//定义局部临时表,表名前必须加一个#
(
num nvarchar(50),
name nvarchar(50)
)
insert into #temp_stu values('456895','张三')//向临时表中插入数据
select * from #temp_stu//查询临时表
全局临时表: