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

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

    启用Ad Hoc Distributed Queries:

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



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

    1. exec sp_configure 'Ad Hoc Distributed Queries',0  
    2. reconfigure  
    3. exec sp_configure 'show advanced options',0  
    4. reconfigure   
    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选项

    做一个优秀的女子,不要停滞不前~
  • 相关阅读:
    OpenGL模板缓冲区与模板测试
    u3d调用c++ dll的DllNotFoundExceion 问题
    u3d调用自己的dll
    使用 idea 的Bookmarks(书签)功能
    maven 相关问题
    项目
    使用 vi/vim 时,粘贴进新创建文件或空文件的首行内容丢失的解决方法
    Thread.sleep还是TimeUnit.SECONDS.sleep
    搭建 Guacamole 并解决各种坑和创建不了虚拟驱动器导致无法实现文件传输的方法
    properJavaRDP 跑通本地远程桌面
  • 原文地址:https://www.cnblogs.com/njshiney/p/njshiney.html
Copyright © 2011-2022 走看看