sql存储过程的while循环
alter procedure time_by
as
Declare @Count Int
Set @Count=1099
While @Count<=4298 --@Count的初值为1099,自然不会大于等于4298,while循环也自然不会执行
Begin
update Time_by_day set Time_ID=(@Count-1098) where Time_ID=@Count
Set @Count=@Count+1
End
Go
执行存储过程:
execute time_by
as
Declare @Count Int
Set @Count=1099
While @Count<=4298 --@Count的初值为1099,自然不会大于等于4298,while循环也自然不会执行
Begin
update Time_by_day set Time_ID=(@Count-1098) where Time_ID=@Count
Set @Count=@Count+1
End
Go
执行存储过程:
execute time_by
长期招聘java,有找工作可以联系我,微信:caozhenhua1563