Setting the value of the Ad-hoc Distributed Queries server configuration option to 0

The Ad-hoc distributed queries option must be disabled. If this option is enabled, you can query data and execute statements on the external data sources.

To disable the Ad-hoc distributed queries, run this T-SQL command on the IRC and the CM database:

EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE;
EXECUTE sp_configure 'Ad Hoc Distributed Queries', 0;RECONFIGURE;
GO
EXECUTE sp_configure 'show advanced options', 0;RECONFIGURE;