如何同步Sql数据库 [英] How to sync Sql database

查看:75
本文介绍了如何同步Sql数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我遇到了其中一项要求。



- 我有两个数据库ABC和XYZ。

- 在这两个数据库中我们有一个表Employee(两个数据库的模式都是相同的)。

- 我们什么时候插入记录到 [ABC] .Employee 它应该与另一个数据库表同步 [XYZ] .Employee

- 我去过在我的制作中使用Sql server 2008R2和VS2013。



我不想复制数据库或恢复数据库。



我们是否有任何实用程序或任何规定来同步两个不同数据库中的数据,请分享。帮助会非常明显。



谢谢&问候,

deepakaitr12345

Hi Friends,

I came across one of the requirement that is.

--I have two database ABC and XYZ.
--Under Both the DB we have one table Employee(Schema of both the database is same).
--Whenever we insert the record into [ABC].Employee it should be sync with the another database table [XYZ].Employee.
--I have been using Sql server 2008R2 and VS2013 on my production.

I don't want to replicate databases or restore Database.

Do we have any utility or any provision to sync the data in two different database, Please share. Help would be greatly appreciable.

Thanks & Regards,
deepakaitr12345

推荐答案

您可以在Employee表中维护布尔列同步。当记录更新为[XYZ]时更新为true。员工。



每当用户更改ABC中的现有员工记录时,请确保列Sync是设为false。因此,当您复制时,它将使用您维护的唯一键在XYZ中更新此记录。
You can maintain a boolean column sync in the Employee table. Update it to true when the record is updated to [XYZ].Employee.

Also whenever the user changes the existing Employee records in ABC, make sure the column Sync is set to false . So that when you are replicating it will update this record in XYZ using the unique key you have maintained.


这篇关于如何同步Sql数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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