首页 > 数据库技术 > 详细

T-SQL远程连接操作

时间:2016-07-14 17:23:09      阅读:266      评论:0      收藏:0      [点我收藏+]
-- 开启
exec sp_configure ‘show advanced options‘,1
reconfigure
exec sp_configure ‘Ad Hoc Distributed Queries‘,1
reconfigure


SELECT top 5 * FROM OPENDATASOURCE(‘SQLOLEDB‘,‘Data Source=192.168.2.208;User ID=sa;Password=ccpg@2015‘).[CCPG_PM].dbo.[COM_UserInfo] P where p.[GC_Flag]=0

SELECT top 5 * FROM OPENROWSET(‘SQLNCLI‘,‘192.168.2.208‘;‘sa‘;‘ccpg@2015‘,‘select * from [CCPG_PM].dbo.[COM_UserInfo] P where p.[GC_Flag]=0‘) AS a -- 关闭 exec sp_configure ‘Ad Hoc Distributed Queries‘,0 reconfigure exec sp_configure ‘show advanced options‘,0 reconfigure

 

T-SQL远程连接操作

原文:http://www.cnblogs.com/zhuyongblogs/p/5671063.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!