当我在SQL Server2000中使用OPENROWSET运行查询时,它可以工作。
但SQL Server 2008中的相同查询会生成以下错误:
SQL server阻止了对组件“”即席分布式查询“”的语句“”OpenRowset/OpenDatasource“”的访问,因为此组件作为此服务器的安全配置的一部分已关闭。“系统管理员可以通过使用sp_configure
启用‘即席分布式查询’的使用
发布于 2013-01-27 11:54:22
下面的命令可能会对您有所帮助。
EXEC sp_configure 'show advanced options', 1
RECONFIGURE
GO
EXEC sp_configure 'ad hoc distributed queries', 1
RECONFIGURE
GO发布于 2013-01-28 02:36:14
您可以检查以下命令
sp_configure 'show advanced options', 1;
RECONFIGURE;
GO --Added
sp_configure 'Ad Hoc Distributed Queries', 1;
RECONFIGURE;
GO
SELECT a.*
FROM OPENROWSET('SQLNCLI', 'Server=Seattle1;Trusted_Connection=yes;',
'SELECT GroupName, Name, DepartmentID
FROM AdventureWorks2012.HumanResources.Department
ORDER BY GroupName, Name') AS a;
GO或者这个documentation link
发布于 2017-01-27 22:41:43
如果对系统目录的即席更新“不受支持”,或者如果你得到一个"Msg 5808“,那么你需要像这样配置覆盖:
EXEC sp_configure 'show advanced options', 1
RECONFIGURE with override
GO
EXEC sp_configure 'ad hoc distributed queries', 1
RECONFIGURE with override
GOhttps://stackoverflow.com/questions/14544221
复制相似问题