sql server中语句变量自增

2024-11-27 09:17:00
推荐回答(4个)
回答1:

while循环要加上begin end
@i = @i+1 要改为 set @i = @i+1

回答2:

declare @i int
set @i=3
while @i<10
begin
insert into student(id,name,email) values(@i,'er','we.f')
set @i = @i+1
end

回答3:

while后面的循环要加上begin end

回答4:

set @i = @i+1