-- 创建触发器 CREATE TRIGGER tr_t_user_update_time ON t_user -- 触发时机、条件 AFTER UPDATE AS BEGIN SET NOCOUNT ON; UPDATE t_user SET update_time = SYSDATETIME() WHERE ID IN (SELECT DISTINCT ID FROM inserted) END GO -- 启动触发器 ALTER TABLE t_user ENABLE TRIGGER tr_t_user_update_time
-- 删除触发器 DROP TRIGGER tr_t_user_update_time
标签:触发器,--,tr,update,server,user,自动更新,time From: https://www.cnblogs.com/sunline/p/16985047.html