1.11.11

Error in executing OpenRowset or OpenDatasource queries

While executing  OpenRowset or OpenDatasource queries, you will get the below error.

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. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries',

Solution:

By default, SQL Server will disable the options related to the server. We need to enable the same by executing the below queries.

EXEC sp_configure 'show advanced options', 1
RECONFIGURE WITH OVERRIDE
EXEC sp_configure 'Ad Hoc Distributed Queries', 1
RECONFIGURE WITH OVERRIDE

Cheers,
Venkatesan Prabu. J
Head  - Kaashiv InfoTech, Chennai

No comments:

Post a Comment