触发器

 

关联更新

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

posted @ 2015-07-09 15:37  常平  阅读(132)  评论(0编辑  收藏  举报