如何同步2个数据库表 [英] How Do I Sync 2 Table Of Databases

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

问题描述


我在2台服务器上有2个数据库,但在表中相同



在数据库A(带有静态IP的云服务器)中插入table1使用我的本地应用程序在DB B中(在没有静态IP的本地服务器中)插入table2和/或
现在我需要编写一些代码来同步我在本地c#应用程序中单击sysn按钮时的那些



同步说明:



DB_A.table1 DB_B.table1

AND

DB_A.table2使用DB_B.table2



(从A.tb1获取并插入B.tb1并从B.table2获取并插入在A.tb1)



请帮帮我怎么办?



问候

Hi I have 2 database in 2 servers but same in tables

inserting in table1 in database A (cloud server with static IP) with my website and inserting table2 in DB B (in local server without static IP) with my local application
now i need to write some code to sync those when in click sysn button in my local c# application

sync description:

DB_A.table1 With DB_B.table1
AND
DB_A.table2 With DB_B.table2

(Get from A.tb1 and insert in to B.tb1 and Get from B.table2 and insert in A.tb1 )

please help me how can i do that?

regards

推荐答案



老实说,做这项工作你有很多解决方案只是试着去寻找你会发现很棒的解决方案,比如制作镜像数据库,转发或使用网络服务(当然我喜欢这个想法;-))我还有一个其他的解决方案是自同步数据访问层 [ ^ ]您可以为您的应用程序创建自我Sychn机制,只需告诉我您是否需要更多信息。



其他有用的链接:

https://msdn.microsoft.com/en-us/sync/bb887608.aspx [ ^ ]

http://social.technet.microsoft.com/wiki/contents/articles/4654.sql-server-replication-technologies.aspx [ ^ ]

http://www.symmetricds.org/ [ ^ ]

https://en.wikipedia.org/wiki/Microsoft_Sync_Framework [ ^ ]
Hi
To do be honest for doing this work you have a lot solutions just try to goggling you will find amazing solutions like making mirror database, Ip forwarding or using web service (of course I like it this idea ;-) ) and I have a other solution for you that is Self-Synchronized Data Access Layer[^] in this article with small change you create self-Sychn mechanism for your application, just let me know if you need more information.

Other useful Links:
https://msdn.microsoft.com/en-us/sync/bb887608.aspx[^]
http://social.technet.microsoft.com/wiki/contents/articles/4654.sql-server-replication-technologies.aspx[^]
http://www.symmetricds.org/[^]
https://en.wikipedia.org/wiki/Microsoft_Sync_Framework[^]


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

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