SQLSERVER 启用跨库查询脚本

启用Ad Hoc Distributed Queries的方法,执行下面的查询语句就可以了:

exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
使用完毕后,记得一定要要关闭它,因为这是一个安全隐患,切记执行下面的SQL语句

exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure 
原文地址:https://www.cnblogs.com/panz/p/5543269.html