触发器中获取sql
2024-10-19 21:27:37
CREATE trigger 触发器名
on 表名
for update,delete
as
set nocount on
create table #t(EvebtType varchar(60),Parameters int,EventInfo varchar(2000))
declare @id varchar(20)
set @id=@@spid
insert #t
exec('DBCC INPUTBUFFER ('+@id+')') if exists (select 1 from #t where EventInfo not like '%where%')
BEGIN
RAISERROR ('删除、修改语句必须写where部分',16, 1)
ROLLBACK TRANSACTION
END
最新文章
- Word2vec多线程(tensorflow)
- 使用PowerShell解三道测试开发笔试题
- 利用opencv训练样本分类
- EF6 CodeFirst+Repository+Ninject+MVC4+EasyUI实践(九)
- (c语言编程)出现错误:null undeclared identifier
- [LeetCode]题解(python):047-Permutations II
- C#连接数据库的四种方法(转)
- UIcollectionView的使用(首页的搭建2)
- 开源负载测试工具k6比JMeter更容易的5件事
- Python函数分类及操作
- bsxfun, arrayfun, cellfun, spfun, structfun
- SharePoint 2013 Workflow Manager 1.0 远程服务器返回错误: (400) 错误的请求。 不支持查询字符串中的 api-version
- jqgrid 设置冻结列
- 如何看一段JAVA代码耗了多少内存
- 【Linux】cat充当vi使用(特殊用法)
- ios中要在tableview中添加事件的方法
- LeetCode 11 Container With Most Water(分支​判断问题)
- yii2中关联查询
- zoj 2314 Reactor Cooling (无源汇上下界可行流)
- dwr的A request has been denied as a potential CSRF attack.错误
热门文章
- Go语言核心36讲(Go语言实战与应用二十七)--学习笔记
- java 输入输出IO流:FileOutputStream FileInputStream
- 再识requests
- 网络编程socket 结合IO多路复用select; epool机制分别实现单线程并发TCP服务器
- mysql 在删除数据出现Cannot delete or update a parent row: a foreign key constraint fails 这个该如何解决
- 【LeetCode】169. Majority Element 解题报告(Java & Python & C+)
- 【九度OJ】题目1153:括号匹配问题 解题报告
- 【LeetCode】999. Available Captures for Rook 解题报告(C++)
- 【LeetCode】49. Group Anagrams 解题报告(Python & Java & C++)
- 【LeetCode】388. Longest Absolute File Path 解题报告(Python)