SQL Trigger 判断增删改
--update
if ((exists (select 1 from inserted)) and (exists (select 1 from deleted)))
--insert
else if (exists (select 1 from inserted) and not exists (select 1 from deleted))
--delete
else if (not exists (select 1 from inserted) and exists (select 1 from deleted))
判断当前修改的某一列是否变化
if((select count(*) from inserted a inner join deleted b on a.ADAccount = b.ADAccount and a.IsDefaultScore <> b.IsDefaultScore)>0)
ADAccount 是主键
IsDefaultScore 是判断是否有改变的列