请问如何在保存单据之前执行触发器?
create trigger wcmo on [dbo].[ICStockBill]
for insert,update
as
Declare @Ftrantype int --单据类别定义
Select @Ftrantype=Ftrantype from inserted
if (@Ftrantype=28)
begin
update t2 set t2.fentryselfb0847=t4.fbillno --(需要点软件的“保存“按钮才会执行更新?能否做到只要t2表有一有数据插入就更新?)
from inserted as t1
inner join icstockbillentry as t2 on t2.finterid=t1.finterid
inner join icmo as t3 on t3.finterid=t2.fsourceinterid
inner join seorder as t4 on t4.finterid=t3.forderinterid
return
end