日期:2014-05-16 浏览次数:20537 次
create trigger tr_tableb
on B表 for update
as
begin
if update(OutNumber)
begin
update a
set a.aOutNumber=case when b.[Type]='A' then b.OutNumber else a.aOutNumber end,
a.bOutNumber=case when b.[Type]='B' then b.OutNumber else a.bOutNumber end
from A表 a
inner join inserted b on a.aID=b.aID
end
end