declare @c_bid int,@c_aa int
declare cur cursor for select * from t2
open cur
fetch next from cur into @c_bid,@c_aa
while @@fetch_status = 0
begin
update t1 set aa = @c_aa where bid = @c_bid
fetch next from cur into @c_bid,@c_aa
end
close cur
deallocate cur
declare cur cursor for select * from t2
open cur
fetch next from cur into @c_bid,@c_aa
while @@fetch_status = 0
begin
update t1 set aa = @c_aa where bid = @c_bid
fetch next from cur into @c_bid,@c_aa
end
close cur
deallocate cur
浙公网安备 33010602011771号