zoukankan      html  css  js  c++  java
  • SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问

    原因:在从远程服务器复制数据到本地时出现“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?
    exec sp_configure 'show advanced options',1
    reconfigure
    exec sp_configure 'Ad Hoc Distributed Queries',1
    reconfigure


    使用完成后,关闭Ad Hoc Distributed Queries:
    [sql] view plaincopyprint?
    exec sp_configure 'Ad Hoc Distributed Queries',0
    reconfigure
    exec sp_configure 'show advanced options',0
    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!!!

  • 相关阅读:
    python实现从生成器中取固定角标的元素
    python-高阶函数
    git学习手册
    python批量进行文件修改操作
    python第一站
    LoadRunner,一个简单的例子
    python3中urllib2的问题
    gitlab 随笔
    sed 删除文本
    sed 修改文本
  • 原文地址:https://www.cnblogs.com/Demcia/p/3939242.html
Copyright © 2011-2022 走看看