首页 > 代码库 > 修改、删除 触发器

修改、删除 触发器

1.修改

CREATE TRIGGER DJSLSQ_update-----
   ON  DJSLSQ-----
   AFTER update
AS
BEGIN
 
 SET NOCOUNT ON;

    Insert INTO DJSLSQ_update_tri-----
 select *,‘修改前数据:‘+CONVERT(varchar(100), GETDATE(), 20) from deleted t

   Insert INTO DJSLSQ_update_tri-----
 select *,‘修改后数据:‘+CONVERT(varchar(100), GETDATE(), 20) from inserted t

END

 

2.删除

CREATE TRIGGER DJSLSQ_delete-----
   ON  DJSLSQ-----
   AFTER delete
AS
BEGIN
 
 SET NOCOUNT ON;

    Insert INTO DJSLSQ_delete_tri-----
 select *,‘删除的数据:‘+CONVERT(varchar(100), GETDATE(), 20) from deleted t

 

END

修改、删除 触发器