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
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')