Home >Database >Mysql Tutorial >SQL2005行触发器

SQL2005行触发器

WBOY
WBOYOriginal
2016-06-07 14:54:071461browse

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn