--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 是判斷是否有改變的列