SQL Server blocked access to the STATEMENT ' Openrowset/opendatasource ' of the component ' Ad Hoc distributed Queries '

Source: Internet
Author: User
Tags ole

Cause: "SQL Server blocked access to component ' Ad Hoc distributed Queries ' STATEMENT ' Openrowset/opendatasource" when replicating data from a remote server to local Because this component has been shut down as part of this server's security configuration. System administrators can enable ' Ad Hoc distributed Queries ' by using sp_configure. For more information about enabling ' Ad Hoc distributed Queries ' error, search online to find the following workaround:
Enable AD Hoc distributed Queries:
[SQL] View plaincopyprint?
exec sp_configure ' show advanced options ', 1
Reconfigure
exec sp_configure ' Ad Hoc distributed Queries ', 1
Reconfigure


When you are finished using, close ad Hoc distributed Queries:
[SQL] View plaincopyprint?
exec sp_configure ' Ad Hoc distributed Queries ', 0
Reconfigure
exec sp_configure ' show advanced options ', 0
Reconfigure
I verify success:
After querying SQL Books Online, MSDN official for the following content:

By default, SQL Server does not allow project distributed queries to use OPENROWSET and OPENDATASOURCE. When the This option was set to 1, SQL Server allows ad hoc access. The 1,sql Server allows ad-hoc access. When the This option was not set or was set to 0, SQL server does was not allowed ad hoc access. When you do not set or set the 0,sql Server to disallow ad hoc access.
Ad hoc distributed queries use the OPENROWSET and OPENDATASOURCE functions to connect to remote data sources this use OLE db. Ad hoc distributed queries use the OPENROWSET and OPENDATASOURCE functions to connect to remote data sources using OLE DB. OPENROWSET and OpenDataSource should is used only to reference OLE DB data sources that is accessed infrequently. OpenRowset and OPENDATASOURCE should only be used to reference OLE DB data sources with little access. For any data sources, the will is accessed more than several times, define a linked server. The linked server is defined more than any datasource that is accessed more than once.
Security Note safety Precautions
Enabling the use of ad hoc names means, a authenticated login to SQL Server can access the provider. Enabling the project name to be used means any Verify that you are logged on to a vendor that SQL Server can access. SQL Server Administrators should enable this feature for providers that is safe to be accessed by any local login. SQL Server administrators should enable this feature for vendor security, which can be accessed by any local login. For greater information, see the DisallowAdhocAccess option in accessing External data. To learn more, refer to Disallowadhocacce in accessing external data SS option
Http://msdn.microsoft.com/en-us/library/ms187569.aspx
Hereby mark!!!

SQL Server blocked access to the STATEMENT ' Openrowset/opendatasource ' of the component ' Ad Hoc distributed Queries '

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.