如何使用Microsoft sync Framework和C#单独同步两个SQL Server数据库和特定表 [英] How to syncronise two sql server databases with particular tables alone using Microsoft sync Framework and C#

查看:121
本文介绍了如何使用Microsoft sync Framework和C#单独同步两个SQL Server数据库和特定表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

到目前为止,我已经完成了两个SQL Server数据库的同步.
我的意思是仅第一个数据库的副本存在于第二个数据库中.
在此过程中,第二个数据库被删除并使用第一个数据库的数据重新创建.我不需要这样.
我需要的是database1将有40个表.数据库2将具有30个表.
但是两个数据库将共用两个表.我想单独同步这两个表,而不影响其他表.
那可能吗?如果是,请给我一个样品.
非常紧急.
在此先感谢

解决方案

如果我已经了解了您,那么类似(因为您没有提到这些数据库的位置,所以我们假设它们是在同一台服务器上):

delete from DB1..Table1

insert into DB1..Table1
select * from DB2.Table2



那是非常简单的:我会把它留给您来确定细节,也许是通过在这里和在Google上做一些更多的研究.

Hi All

As of now what i have done is, i have synchronised two sql server databases.
I mean the copy of the first database alone exists in the second database.
In this process the second database is deleted and recreated with the data of first database.I don''t need like this.
What i need is database1 will have 40 tables. And database 2 will have 30 tables.
But 2 tables will be common to both databases. I want to synchronise those 2 tables alone without affecting the other tables.
Is that possible? If yes, Can you give me a sample.
It is very urgent.
Thanks in advance

解决方案

If I''ve understood you then something like (since you don''t mention the locations of these databases let''s assume they are on the same server):

delete from DB1..Table1

insert into DB1..Table1
select * from DB2.Table2



That is very simplistic: I''ll leave it to you to work out the fine detail, perhaps by doing some more research here and on Google..


这篇关于如何使用Microsoft sync Framework和C#单独同步两个SQL Server数据库和特定表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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