码迷,mamicode.com
首页 > 数据库 > 详细

Sql Server查询远程db 表数据到本地

时间:2014-10-20 15:10:00      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   sp   数据   2014   on   log   ad   

step 1: 


sp_configure ‘show advanced options‘, 1;
RECONFIGURE;
sp_configure ‘Ad Hoc Distributed Queries‘, 1;
RECONFIGURE;
GO



step 2:



insert into table_name
columns


SELECT 
columns


 FROM OPENROWSET(‘SQLNCLI‘, 
‘Server=XXXX,1433;uid=XXXX;pwd=XXXX;Database=cb_name;‘,‘SELECT * FROM table_name‘) 



Sql Server查询远程db 表数据到本地

标签:style   blog   io   sp   数据   2014   on   log   ad   

原文地址:http://blog.csdn.net/lan_liang/article/details/40300401

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!