您的位置:首页 > 数据库

SQL Server 跨库连接

2016-06-03 12:04 246 查看
-- 开启组件
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure

-- 关闭组件
exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',0
reconfigure


-- 查询远程数据库
SELECT *  FROM OPENDATASOURCE('SQLOLEDB','Data Source=192.168.7.137;User ID=sa;Password=8818522').PanelData.dbo.Channel
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: