如何在不替换现有数据的情况下集成两个相同的数据库? [英] How can i integrate two same database without replacing their existing data?

查看:79
本文介绍了如何在不替换现有数据的情况下集成两个相同的数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Goodmorning everyone。



我需要你的帮助。

我在不同的计算机上有两个数据库。 Database1和Database2。

但它们具有相同的结构,这两个数据库中的表和列真的是一样的。



我想要什么要做的就是将它整合为一体。这样来自Database2的数据现在可以在Database1中访问。



有没有人知道如何在不替换Database1现有数据的情况下集成这些数据库?



任何帮助或建议都会非常感激。

非常感谢你,

上帝保佑。

Goodmorning everyone.

I need your help.
I have two database in different computer. Database1 and Database2.
but they have same structures, the tables and columns within those two database are really the same.

what i want to do is to integrate it into one. so that the data from the Database2 can now be access in the Database1.

Is there anyway one know how to integrate those database without replacing the existing data of Database1?

Any help or Suggestions will be so much appreciated.
Thank you so much,
God bless.

推荐答案

我建​​议您使用MSSQL 2008R或更高版本(推荐)



您需要进行案例研究执行:


$ B $ Server1在Server1的server1

Server1在Database2的Server2



您应该为Server2创建链接服务器广告服务器对象,在Server1上使用名称DBLink,并且所有用户身份验证都登录到server2。



在Server1和database1上你写了查询:



从dbo.table1中选择*

union

select * from DBLink.database2.dbo。 table1



希望这对你有用。



Trong Anh
I suggest you use MSSQL 2008R or later (recommended)

There is case studies you should do:

table1 in Database1 at Server1
table1 in Database2 at Server2

You should create the Linked Server ad Server Object for Database2 with the name DBLink on Server1 with all user authentication login to server2.

at Server1 and database1 you write the query:

Select * from dbo.table1
union
select * from DBLink.database2.dbo.table1

Hope this usefule for you.

Trong Anh


这篇关于如何在不替换现有数据的情况下集成两个相同的数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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