触发器
关联更新
create trigger Customer_Update
on Customer after update
as
update Customer set OrgNamePY = dbo.fun_getPY(Customer.OrgName)
from Customer,deleted
where Customer.CustomerId=deleted.CustomerId
create trigger Customer_Insert
on Customer after Insert
as
update Customer set OrgNamePY = dbo.fun_getPY(Customer.OrgName)
from Customer,inserted
where Customer.CustomerId=inserted.CustomerId