MSSQL跨库查询

作者: admin 分类: SQLServer 发布时间: 2011-12-13 16:59 ė 6 MSSQL跨库查询已关闭评论

–跨库查询
select * FROM OPENDATASOURCE(
‘SQLOLEDB’,
‘Data Source=192.168.0.5,1433;User ID=sa;Password=sa’
).dbName.dbo.tableName

–打开
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

本文出自weicms.net,转载时请注明出处及相应链接。

本文永久链接: http://www.weicms.net/2011/12/13/kuakuselect.html

0
Ɣ回顶部