UPDATE [dbo].[TLotterySpiderRule] SET [Id] = 0

declare cus_cursor cursor scroll for 
SELECT Id from [dbo].[TLotterySpiderRule] 
open cus_cursor
declare @Id int
declare @count int
set @count=0
fetch next from cus_cursor into @Id
while @@FETCH_STATUS=0
begin
set @count=(@count+1)
print @count
UPDATE [dbo].[TLotterySpiderRule] SET [Id] = @count where id = @id
fetch next from cus_cursor into @Id
end
close cus_cursor
deallocate cus_cursor

 

posted on 2014-04-01 16:20  深海大虾  阅读(317)  评论(0编辑  收藏  举报