Declare
MyCursor
cursor
scroll
for
select
CpBH, N
from
Acc_CpFk
where
Bm =
'556仓库'
order
by
CpBH
Open
MyCursor
Declare
@CpBH
varchar
(20)
Declare
@N
int
FETCH
Next
FROM
MyCursor
into
@CpBH, @N
while (@@fetch_status=0)
begin
Update
Acc_CpFk
set
N = @N
where
CpBH = @CpBH
and
Bm =
'1556仓库'
FETCH
next
from
Mycursor
into
@CpBH, @N
end
Close
MyCursor
deallocate
mycursor