使用更改跟踪在两个sql数据库之间同步。 [英] Sync between two sql database using change tracking.

查看:133
本文介绍了使用更改跟踪在两个sql数据库之间同步。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用SQL Server更改跟踪功能在Sql server 2008 Express版本作为客户端和Sql server 2008之间同步作为服务器。我正在使用DbServerSyncProvider和SqlExpressClientSyncProvider(取自以下链接)。

I am trying to sync between Sql server 2008 Express edition as client and Sql server 2008 as server using SQL Server change tracking feature. I am using DbServerSyncProvider and SqlExpressClientSyncProvider (taken from the below link).

http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sync&ReleaseId=1200

此示例使用自己的改变跟踪概念进行同步。我正在尝试使用sql server的内部更改跟踪,但我坚持定义一些函数,如GetTableReceivedAnchor,GetTableSentAnchor,SetTableReceivedAnchor ......有人可以给我一个例子,或者给我一些提示来定义这些内部函数更改跟踪。

This example uses its own change tracking concept for synchronization. I am trying to use internal change tracking of sql server, but I am stuck on definition of some functions like GetTableReceivedAnchor, GetTableSentAnchor, SetTableReceivedAnchor ... Can somebody please give me an example for this or provide me some hint to define these functions for internal change tracking.

谢谢,

推荐答案

afaik,你不应该改变它们。  ;

afaik, you shouldnt have to change them. 

SQL更改跟踪,它只是用于检索从您正在同步的表中添加/更新/删除的内容,但它不会跟踪发送和接收的内容。

The SQL Change tracking, it's just for retreiving the what was added/updated/deleted from the tables you're synching but it doesnt track what was sent and received.

锚点功能用于在锚表中保存每个表格的发送内容和收到的内容。

The anchor functions are for saving  in the anchor table what was sent and what was received for each table.

要使用SQL更改跟踪,您需要只需更新SelectIncremental查询以及应用插入/更新/删除的命令。

To use SQL Change tracking, you just have to update your SelectIncremental queries as well as the commands for applying Insert/Update/Delete.

 


这篇关于使用更改跟踪在两个sql数据库之间同步。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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