更新某个字段时,引起的触发事件?
请问触发器里.
要求: 更新某个字段时,引起的触发事件?
应该怎么写逻辑 说下思路即可 谢谢~~~
create trigger tr_update on TableName
FOR update
as
..........
------解决方案--------------------create trigger tr_update on TableName
FOR update
as
if update(fieldname)
begin
.............
end
------解决方案--------------------if exists(select 1 from inserted i join deleted d on d.主键 = i.主键 and i.字段 <> d.字段)
begin
end