欢迎光临
我们一直在努力

思迅实施助手在操作的时候出现SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问解决办法!

在从远程服务器复制数据到本地时出现“SQL Server 阻止了对组件 ‘Ad Hoc Distributed Queries‘ 的 STATEMENT’OpenRowset/OpenDatasource‘ 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 ‘Ad Hoc Distributed Queries’。

原因:在从远程服务器复制数据到本地时出现“SQL Server 阻止了对组件 ‘Ad Hoc Distributed Queries’ 的 STATEMENT’OpenRowset/OpenDatasource’ 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 ‘Ad Hoc Distributed Queries’。有关启用 ‘Ad Hoc Distributed Queries’ 的详细信息 ”错误,因此网上搜索,发现以下解决方法:

启用Ad Hoc Distributed Queries:

[sql] view plaincopyprint?

  1. exec sp_configure ‘show advanced options’,1
  2. reconfigure
  3. exec sp_configure ‘Ad Hoc Distributed Queries’,1
  4. reconfigure

使用完成后,关闭Ad Hoc Distributed Queries:

[sql] view plaincopyprint?

  1. exec sp_configure ‘Ad Hoc Distributed Queries’,0
  2. reconfigure
  3. exec sp_configure ‘show advanced options’,0
  4. reconfigure

本人验证成功:

后查询SQL联机丛书,MSDN官方为下以内容:

 

默认情况下,SQL Server并不允许专案分布式查询使用OPENROWSET和OPENDATASOURCE。 When this option is set to 1, SQL Server allows ad hoc access.当这个选项被设置为1,SQL Server允许即席访问。 When this option is not set or is set to 0, SQL Server does not allow ad hoc access.当此选项未设置或设置为0,SQL Server不允许即席访问。

Ad hoc distributed queries use the OPENROWSET and OPENDATASOURCE functions to connect to remote data sources that use OLE DB.特设分布式查询使用OPENROWSET和OPENDATASOURCE函数连接到远程数据源,使用OLE DB。 OPENROWSET and OPENDATASOURCE should be used only to reference OLE DB data sources that are accessed infrequently. OPENROWSET和OPENDATASOURCE应该只用于引用OLE DB数据源很少访问。 For any data sources that will be accessed more than several times, define a linked server.将会比多次访问的任何数据源,定义链接服务器。

Security Note 安全注意事项
Enabling the use of ad hoc names means that any authenticated login to SQL Server can access the provider.启用使用的专案名称,意味着任何身份验证登录到SQL Server可以访问的供应商。 SQL Server administrators should enable this feature for providers that are safe to be accessed by any local login. SQL Server管理员应该启用此功能为供应商,安全,可以由任何本地登录访问。 For more information, see the DisallowAdhocAccess option in Accessing External Data .欲了解更多信息,请参阅在访问外部数据 的DisallowAdhocAccess选项

http://msdn.microsoft.com/en-us/library/ms187569.aspx

特此MARK!!!

赞(0)
未经允许不得转载:简单网 » 思迅实施助手在操作的时候出现SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问解决办法!

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址