邹建,请进来帮我看看。谢谢!(没分了,下次补过)

ranman ranman 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我创建了一个trigger,调用sp_testdll,想触发执行该存储过程,但是出了下面的一些错误信息提示(不能在事务内部执行过程 'sp_addextendedproc'
),我在查询分析器里执行该存储过程可以,请问是什么原因?怎样才能在trigger里执行存储过程呢?
CREATE PROCEDURE sp_testdll AS
exec sp_addextendedproc "SetFileName","StoreProc.dll"
exec sp_addextendedproc "addLine","StoreProc.dll"
declare @szFileName varchar(200)
declare @szText varchar(200)
declare @rt int

select @szFileName="C:\WelCome.txt"
exec @rt=SetFileName @szFileName
if @rt=0
begin
select @szText="Welcome 01"
exec @rt=addLine @szText
end
exec sp_dropextendedproc "SetFileName"
exec sp_dropextendedproc "addLine"
dbcc SetFileName (free)
dbcc addLine (free)
GO
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
ranman
MS-SQL Server 34,876 成员 254,635 内容