日期:2014-05-17 浏览次数:20562 次
create trigger trg_bil_changedtl_insert
on bil_changedtl for insert,update
as
set nocount on
declare @shoptype smallint,@shopmode smallint,@shopcode char(10),@parmvalue smallint
select @shoptype = type,@shopmode = mode,@shopcode = shopcode
from inf_thisshop
if @shoptype = 1 or @shopmode = 1
begin
insert into log_goods_price_change
select shopcode,oldgdsincode,1,billno,oldsaleprice,newsaleprice,null,null,changedate
from inserted,inf_department
where inserted.deptcode = inf_department.deptcode
and inserted.dealflag = 2
end
set nocount off
;
create trigger trg_bil_change_shoppricedtl_insert
on bil_change_shoppricedtl for insert,update
as
set nocount on
declare @shoptype smallint,@shopmode smallint,@shopcode char(10),@parmvalue smallint
select @shoptype = type,@shopmode = mode,@shopcode = shopcode
from inf_thisshop
if @shoptype = 1 or @shopmode = 1
begin
insert into log_goods_price_change
select deptcode,gdsincode,1,billno,oldshopprice,newshopprice,null,null,changedate
from inserted
where inserted.dealflag = 2
end
set nocount off
ALTER TABLE bil_changedt ENABLE TRIGGER ALL