sql数据同步两个表,但每个表的方向不同 [英] sql data sync two tables but each in a different direction

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

问题描述

如果您有一个表需要纯粹地到集线器",另一个不同的表 则需要完全来自中心"如何设置每张桌子的方向?是两个会员"吗?项目 还是每个表都需要位于单独的数据库中,而每个表都需要位于一个单独的数据库中,可以在此数据库中设置每个数据库的方向,并在前提下在同步代理中设置一个新条目(键和寄存器)?

If you have one table that needs to be purely "To the Hub" and another different table  that needs to be purely "From the Hub"  how to you set the direction per table? Is it a matter of two "Member" items under the same syncgroup and syncagent... Or does each table need to be in a separate database where the direction can be set per database and a new entry (key and register) in the sync agent on the premise?

很难说出每个步骤的内容...方向是一个明确的选择,但不是特定的表选择屏幕,而是每个数据库的成员设置屏幕?设置屏幕为同步成员名称",本地数据库" 连接到此代理,并同步方向:从集线器双向同步到集线器.

Its hard to tell what goes with each step ...the direction is a clear choice in there but its not with the specific table choice screens its with the member setup ones that seem to be per database ? The setup screen is Sync Member Name, On premises database connected to this agent, and sync directions : Bi-direction sync, to the hub, from the hub.

双向同步不会给我们每个表正确的结果,因为我们希望它清除中心表并仅从前提中填充新项.或对于第二张表,清除前提并仅填充中心中的项目.

Bi direction sync would not give us the right results per table as we want it to clear out the hub table and populate only new items from the premise. Or for the 2nd table clear out the premise and populate only with items from the hub.

推荐答案

您可以将同一数据库两次添加到同一同步组中,作为两个不同的成员.但这将在您的用例中起作用,因为在同步组中只能有一个同步模式定义.它将创建循环同步.您的同步作业将永远无法完成.

You can add the same database twice to the same sync group as two different members. But it would work in your use case since there can be only one sync schema definition in a sync group. And it will create a circular sync. Your sync job will never finish.

在这种情况下,您需要创建两个不同的同步组,一个将同步表1从集线器同步到成员,另一个将同步表2从成员同步到集线器.

In this case, you need to create two different sync groups, one to sync table1 from hub to member, another one to sync table2 from member to hub.


这篇关于sql数据同步两个表,但每个表的方向不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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