






















Sql Server触发器调用exe程序
先在Sql Server中添加启动,需要手动启动(我用的是2019)
-- 启用 xp_cmdshell EXEC sp_configure 'show advanced options', 1 RECONFIGURE EXEC sp_configure 'xp_cmdshell', 1 RECONFIGURE
--- 执行过程 EXEC xp_cmdshell 'D:\bin\Debug\net8.0\DownloadImg.exe'
创建触发器
CREATE TRIGGER InsertIMG on SystemLog AFTER INSERT AS BEGIN EXEC xp_cmdshell 'D:\bin\Debug\net8.0\DownloadImg.exe' END
插入数据之后触发,亲测确实是触发了,但最后一条数据没有到想要的结果中,待补充........
insert into SystemLog (Date ,thread) values(GETDATE(),'https://q8.itc.cn/q_70/images03/20240421/e0a5f758921840449f1561e206243211.jpeg')
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。