概述
/****** Object: Trigger [dbo].[trigger_Insert_ProjectItem] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
--工程表插入触发器
ALTER trigger [dbo].[trigger_Insert_ProjectItem]
on [dbo].[ProjectItem]
after insert
as
insert into [Log_ProjectItem](GCID, XMID, GCMC, XMMC, JZMJ, GCFL1, GCFL2, GCFL3, SYXZ, SHDXNR, Address, JGLX, JCLX, DSCS,
DXCS, DSMJ, DXMJ, GCZJ, JHKGRQ, JHJGRQ, SGDW, SGDWZZZ, SGDWXMJL, XMJLJBZ, KCDW, KCDWZZZ,
XMKCFZR, XMKCFZRZCZGZH, SJDW, SJDWZZZ, XMJZSJFZR, XMJZSJFZRZCZGZH, XMJGSJFZR,
XMJGSJFZRZCZGZH, JLDW, JLDWZZZSH, JLS, JLSZCJGZH, QualifiedBook, NoticeAndContract, PersonnelList,
OtherFiles, JSDW, JSDWFDDB, JSDWXMFZR, JSDWFZRTEL, BBRQ, JDZSHYJ, XXJD, SHZTID, SHZT, IsTempSave,
ZJY, ZJYMC, SHR, SHRQ, CJRQ, XGRQ, CJR, CGR, BYID, SGDWTel, JSDWTel, JLDWTel, IsJunGong, IsGet, RegisterNo,
SerialNumber, Lon, Lat, ZJY2, ZJY2MC, ZJY3, ZJY3MC, ZJY4, ZJY4MC, EngType, LXR, LXR_Tel,[IsVaild],[CreateType],[LogCreateTime])
select *,'insert',getdate() from inserted
/****** Object: Trigger [dbo].[trigger_Update_ProjectItem] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
--工程表修改触发器
ALTER trigger [dbo].[trigger_Update_ProjectItem]
on [dbo].[ProjectItem]
after update
as
insert into [Log_ProjectItem] (GCID, XMID, GCMC, XMMC, JZMJ, GCFL1, GCFL2, GCFL3, SYXZ, SHDXNR, Address, JGLX, JCLX, DSCS,
DXCS, DSMJ, DXMJ, GCZJ, JHKGRQ, JHJGRQ, SGDW, SGDWZZZ, SGDWXMJL, XMJLJBZ, KCDW, KCDWZZZ,
XMKCFZR, XMKCFZRZCZGZH, SJDW, SJDWZZZ, XMJZSJFZR, XMJZSJFZRZCZGZH, XMJGSJFZR,
XMJGSJFZRZCZGZH, JLDW, JLDWZZZSH, JLS, JLSZCJGZH, QualifiedBook, NoticeAndContract, PersonnelList,
OtherFiles, JSDW, JSDWFDDB, JSDWXMFZR, JSDWFZRTEL, BBRQ, JDZSHYJ, XXJD, SHZTID, SHZT, IsTempSave,
ZJY, ZJYMC, SHR, SHRQ, CJRQ, XGRQ, CJR, CGR, BYID, SGDWTel, JSDWTel, JLDWTel, IsJunGong, IsGet, RegisterNo,
SerialNumber, Lon, Lat, ZJY2, ZJY2MC, ZJY3, ZJY3MC, ZJY4, ZJY4MC, EngType, LXR, LXR_Tel,[IsVaild],[CreateType],[LogCreateTime])
select *,'update',getdate() from inserted
/****** Object: Trigger [dbo].[trigger_Delete_ProjectItem] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
--工程表删除触发器
ALTER trigger [dbo].[trigger_Delete_ProjectItem]
on [dbo].[ProjectItem]
after delete
as
insert into [Log_ProjectItem](GCID, XMID, GCMC, XMMC, JZMJ, GCFL1, GCFL2, GCFL3, SYXZ, SHDXNR, Address, JGLX, JCLX, DSCS,
DXCS, DSMJ, DXMJ, GCZJ, JHKGRQ, JHJGRQ, SGDW, SGDWZZZ, SGDWXMJL, XMJLJBZ, KCDW, KCDWZZZ,
XMKCFZR, XMKCFZRZCZGZH, SJDW, SJDWZZZ, XMJZSJFZR, XMJZSJFZRZCZGZH, XMJGSJFZR,
XMJGSJFZRZCZGZH, JLDW, JLDWZZZSH, JLS, JLSZCJGZH, QualifiedBook, NoticeAndContract, PersonnelList,
OtherFiles, JSDW, JSDWFDDB, JSDWXMFZR, JSDWFZRTEL, BBRQ, JDZSHYJ, XXJD, SHZTID, SHZT, IsTempSave,
ZJY, ZJYMC, SHR, SHRQ, CJRQ, XGRQ, CJR, CGR, BYID, SGDWTel, JSDWTel, JLDWTel, IsJunGong, IsGet, RegisterNo,
SerialNumber, Lon, Lat, ZJY2, ZJY2MC, ZJY3, ZJY3MC, ZJY4, ZJY4MC, EngType, LXR, LXR_Tel,[IsVaild],[CreateType],[LogCreateTime])
select *,'delete',getdate() from deleted
最后
以上就是笨笨电脑为你收集整理的触发器新增、修改、删除的全部内容,希望文章能够帮你解决触发器新增、修改、删除所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复