触发器点滴

判断操作类型

if exists (select 1 from inserted) and exists (select 1 from deleted)
begin
   
-- update
end

if
exists (select 1 from inserted) and not exists (select 1 from deleted)
begin
   
--insert
end

原文地址:https://www.cnblogs.com/yanghaibo/p/2020729.html