Sql中进行循环操作

declare @i int
declare @base varchar(10)
set @i=10
while(@i<=20)
begin
set @base=right('00'+cast(@i as varchar(10)),6)
update TagInfo set tagID=@base,oldManID=@base where TagInfo.ID=@i
set @i=@i+1
end

人家说 程序员需要比较懒 然后今天试了一下,遇到问题的时候 并不是使用马上想到的方法进行操作,思考一下,然后或许就有新发现

posted on 2012-03-14 17:25  aerkate  阅读(288)  评论(0编辑  收藏  举报

导航