declare @id int,@qty intdeclare curA cursor 
    for
    select id,qty from table1
    for updateopen curAfetch next from curA into @id,@qty
update table1 set qty=50 where current of curA
select @id,50close curA