SQL2005行觸發器
ALTER TRIGGER [dbo].[update_email_template]
on [dbo].[E3_DICT_TABLE]
after update
as
begin
IF (UPDATE (value))
declare @plid varchar(max)--臨時變量,保存 更新數據的 value
declare @oldValue varchar(max)--臨時變量,保存 更新前value
declare @newValue varchar(max)--臨時變量,保存 更新後value
select @plid = id, @oldValue = value from DELETED;
select * from inserted;
where id = @plid;
-- print @plid;
-- print @oldValue #topEmailTem #bottomEmailTem;
-- print @newValue;
begin
if (@plid = '1')
print @oldValue;
print @newValue;
if (@plid = '2')
end
end