select * from openrowset('SQLOLEDB','192.168.6.18';'sa'; sa',ng0002.dbo.warehouse)
SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'Ad Hoc Distributed Queries'。有关启用 'Ad Hoc Distributed Queries' 的详细信息,请参阅 SQL Server 联机丛书中的 "外围应用配置器"。
--启用Ad Hoc Distributed Queries:
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
--使用完成后,关闭Ad Hoc Distributed Queries:
exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure
SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问
最新推荐文章于 2023-07-18 11:01:29 发布
本文解决了一个特定的SQLServer错误:当尝试使用OPENROWSET进行跨服务器查询时,由于'SQLServer Ad Hoc Distributed Queries'组件被禁用而导致的问题。文章提供了详细的步骤来临时启用该组件,完成必要的查询操作,并在使用完毕后将其关闭。
3214

被折叠的 条评论
为什么被折叠?



