Home > Database > Mysql Tutorial > How to Enable Ad Hoc Distributed Queries in SQL Server?

How to Enable Ad Hoc Distributed Queries in SQL Server?

Patricia Arquette
Release: 2024-12-30 01:35:09
Original
766 people have browsed it

How to Enable Ad Hoc Distributed Queries in SQL Server?

Enabling Ad Hoc Distributed Queries in SQL Server

OpenRowset queries that functioned seamlessly in SQL Server 2000 often encounter the following error in SQL Server 2008:

SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server.
Copy after login

To resolve this error and enable Ad Hoc Distributed Queries, follow these steps using sp_configure:

-- Show advanced server configuration options
EXEC sp_configure 'show advanced options', 1
RECONFIGURE

-- Enable Ad Hoc Distributed Queries
EXEC sp_configure 'ad hoc distributed queries', 1
RECONFIGURE
Copy after login

After executing these commands, Ad Hoc Distributed Queries should be enabled for your SQL Server 2008 instance, allowing OpenRowset queries to run successfully.

The above is the detailed content of How to Enable Ad Hoc Distributed Queries in SQL Server?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template