sqlServer执行存储过程报错:42000 - [SQL Server]SQL Server 阻止了对组件“Ole Automation Procedures”

sqlServer执行存储过程报错信息:

42000 - [SQL Server]SQL Server 阻止了对组件“Ole Automation Procedures”的 过程“sys.sp_OACreate”的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用“Ole Automation Procedures”。有关启用“Ole Automation Procedures”的详细信息,请搜索 SQL Server 联机丛书中的“Ole Automation Procedures”。

报错原因是因为没有开启Ole Automation Procedures

开启Ole Automation Procedures方法:
sql运行一下代码即可:

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ole Automation Procedures', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'Ole Automation Procedures';
GO

猜你喜欢

转载自blog.csdn.net/nxw_tsp/article/details/103406139