日期:2014-05-17 浏览次数:20515 次
create trigger tri_u
on Department
after update
as
begin
update a
set DepartmentName=t.DepartmentName_new
from Waybill a
inner join
(select b.DepartmentName as DepartmentName_old,a.DepartmentName as DepartmentName_new
from inserted a
inner join deleted b on a.DepartmentID=b.DepartmentID -->Department表更新时,更新前与更新后关联
)t
on a.DepartmentName=t.DepartmentName_old
end