34,594
社区成员
发帖
与我相关
我的任务
分享
create trigger tt on BOM_027
for insert,update
as
begin
if exists(select 1 from test_jiekou as b ,inserted as i where left(b.testweiyiid,2)=left(i.PARTID,2))
update a set PARTFIXEDBACK3=b.CTYPEID
from BOM_027 as a
join inserted as i on a.CTYPEID=i.CTYPEID
join BOM_083 as b on a.CTYPEID=b.PARTID
end
create trigger b_insupd
on B
for insert,update
as
begin
update A set B=i.B from inserted i
where left(A.A,2)=left(i.B,2);
end
go