判断操作类型
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
判断操作类型
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