0
我有兩個觸發器之一是Instead of update
和其他是after update
在同一個表上相同的任務,但在更新後,而不是觸發器被激發,而如果我有兩個觸發後,然後兩個都觸發更新。這是什麼原因?在同一張桌子上更新和更新後未更新的內容?
create trigger tr_tmp_instead on emp
Instead of update
as
begin
declare @name varchar(50),@message varchar(200)='Updated name Entered Successfully';
select @name=d.name from inserted d;
insert into tmp_Instead values(getdate(),@message,@name)
Print 'Trigger Fired, Updated name Entered Successfully Into tmp_Instead Table..'
end
create trigger tr_tmp on emp
after update
as
begin
declare @name varchar(50),@message varchar(200)='Updated name Entered Successfully';
select @name=d.name from inserted d;
insert into tmp values(getdate(),@message,@name)
Print 'Trigger Fired, Updated name Entered Successfully Into tmp Table..'
end
爲什麼應該在after_update觸發器觸發時執行tmp_instead表中的更新? –