将表specialcarorder中的ordercode字段更新为自增的数
declare @bid int
declare @wincode int
set @wincode=900001
declare cur cursor
read_only
for select id from specialcarorder where activetype=8182
open cur
fetch next from cur into @bid
while(@@fetch_status=0)
begin
update specialcarorder set ordercode=@wincode where id=@bid
set @wincode=@wincode+1
fetch next from cur into @bid
end
close cur
deallocate cur
阅读(2531) | 评论(0) | 转发(0) |