2012-04-24 11:03:00
比如本地数据库名为test1, 表名为testtb,现在想把testtb表导入到远端IP地址为10.25.100.20的机器上,数据库名为test2, 应该怎么操作?
通过SQL语句 ,你需要先联到10.25.100.20 这个库里 ,然后在执行下面的语句
use test2
go
SELECT * into testtb from opendatasource( 'SQLOLEDB', 'Data Source=本地的IP;User ID=登陆名;Password=密码 ' ).test1.dbo.testtb
也可以在本地执行下面的语句,前提是你能在本地通过查询分析器连接到10.25.100.20这个库
use test1
go
select * into opendatasource( 'SQLOLEDB', 'DataSource=10.25.100.20;User ID=登陆名;Password=密码 ' ).test2.dbo.testtb from testtb
select * into Base_QuickMenu from opendatasource('SQLOLEDB','Data Source=192.192.187.233;Initial Catalog=DC;Persist Security Info=True;User ID=erp;Password=erp').DC.dbo.Base_QuickMenu
更多精彩内容:各种AI课程、技能课程、黑科技软件、网站小程序源码、副业小项目、PPT模板等精品素材、电商课程、推广引流课程等,尽在 天边资源网 。