CREATE procedure prcfzGXZCJB @oldnf int,@newnf int as begin insert GXZCJB(DWBH, SJBH, GXBH, CZBH, CZMC, IM, LRXM, SRSJ, havephoto, NF) select DWBH, SJBH, GXBH, CZBH, CZMC, IM, LRXM, SRSJ, havephoto, 2003 from GXZCJB where nf=2002 and 主键 not in (select 主键 from Gxzcjb) end
触发器不好,经常会引起死锁。。
能否用存储过程去实现,
@oldnf int,@newnf int
as
begin
insert GXZCJB(DWBH, SJBH, GXBH, CZBH, CZMC, IM, LRXM, SRSJ, havephoto, NF)
select DWBH, SJBH, GXBH, CZBH, CZMC, IM, LRXM, SRSJ, havephoto, 2003
from GXZCJB
where nf=2002 and 主键 not in (select 主键 from Gxzcjb)
end