create proc test
as
SET NOCOUNT ON;
declare @1 char(100) ,@2 char(100)
declare test_cursor cursor for
select 表a字段2,表a字段3(表bID) from 表a order by 表aID
OPEN test_cursor
FETCH NEXT FROM test_cursor
INTO @1, @2;
while @@FETCH_STATUS =0 begin
update 表a set 表a字段4 =@2 where eid =@1
end
CLOSE product_cursor;
DEALLOCATE product_cursor;
SET NOCOUNT OFF;