如何使用不同服务器位置中存在的不同数据库进行数据迁移 [英] How to work on datamigration with different database present in different server locations

查看:142
本文介绍了如何使用不同服务器位置中存在的不同数据库进行数据迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii to all

i希望获取或复制远程服务器中存在的表数据,或者从本地数据库获取或复制表数据,最好是通过编写过程或触发器。例如,在数据库中有一个名为emp2的表在某个x位置调用db2存在于不同的服务器中。我想获取,将这个emp2表数据从我名为db1的本地数据库复制到名为emp1的表。简单地说,如何通过与同一个数据库进行通信来执行所有数据库操作是不同类型的数据库(sqlserver和mysql或任何两个)通过编写程序和触发器存在于不同的位置。请帮助我如何使用此... ...提前使用thanx

解决方案

有几种方法可以做到这一点。



1.使用链接服务器连接远程服务器。

2.使用分布式查询像OPENROWSET这样的SQL服务器例如



  SELECT  a。*  INTO  dbo.TestDepartment 
FROM OPENROWSET ' SQLNCLI'' Server = Seattle1 ; Trusted_Connection = yes;'
' SELECT GroupName,Name,DepartmentID
FROM AdventureWorks2012.HumanResources.Department
ORDER BY GroupName,Name'
AS a;





欲了解更多信息,请查看:

http://msdn.microsoft.com/en-us/library/ms190312.aspx [ ^ ]


Hii to all
i want to get or copy tables data present in remote server, from or to my local database,preferrably by writing procedures or triggers.For example there is a table called emp2 in database called db2 present in different server at some x location.I want to get,copy this emp2 tables data from my local database called db1 to the table called emp1.Simply how can i perform all database operations by communicating with same are different kind of dtabases(sqlserver and mysql or any two)present in different locations by writing procedures and triggers.Please help me how can i go with this...thanx in advance

解决方案

There are several ways you can do this.

1. Use linked server to connect the remote server.
2. Use distributed query in sql server like OPENROWSET For example

SELECT a.* INTO dbo.TestDepartment
FROM OPENROWSET('SQLNCLI', 'Server=Seattle1;Trusted_Connection=yes;',
     'SELECT GroupName, Name, DepartmentID
      FROM AdventureWorks2012.HumanResources.Department
      ORDER BY GroupName, Name') AS a;



For more information have a look on:
http://msdn.microsoft.com/en-us/library/ms190312.aspx[^]


这篇关于如何使用不同服务器位置中存在的不同数据库进行数据迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆