修改、删除 触发器

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

posted on 2014-11-24 10:37  MyBeN  阅读(399)  评论(0编辑  收藏  举报

导航