在執行openrowset/opendatasource時出的錯。
SQL Server 阻止了對組件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的訪問,因爲此組件已作爲此服務器安全配置的一部分而被關閉。系統管理員可以通過使用 sp_configure 啓用 'Ad Hoc Distributed Queries'。開啓方法如下:
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE with override
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', 1
GO
RECONFIGURE with override
如果沒有加 with override是不能解決的
轉自http://topic.csdn.net/u/20090923/11/428e6ba3-f1d5-4d2b-ab6e-2c746d1d157d.html