--判断名称是否已存在,不建议,万一删了别人创建的呢
if (object_id('tgr_classes_update', 'TR') is not null)
    drop trigger tgr_classes_update

--查询看是否存在
select object_id('tgr_classes_update', 'TR');

--创建update触发器
create trigger tgr_classes_update
on classes
    for update
as
    declare @oldName varchar(20), @newName varchar(20);
    --更新前的数据
    select @oldName = name from deleted;
    --更新后的数据
    select @newName = name from inserted;
    
go

 

 

参考:https://www.cnblogs.com/Brambling/p/6741666.html

https://www.cnblogs.com/hoojo/archive/2011/07/20/2111316.html

 

触发器中获取客户端ip和名称 https://blog.csdn.net/ksrsoft/article/details/8457195

 

相关文章:

  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
  • 2021-05-18
  • 2021-11-07
  • 2021-05-19
  • 2021-11-30
猜你喜欢
  • 2021-08-11
  • 2021-10-15
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
相关资源
相似解决方案