--判斷名稱是否已存在,不建議,萬一刪了別人創建的呢 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
