同步2个SQL Server数据库 [英] Synchronise 2 Sql Server Databases

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

问题描述

你好,我叫Vikash.

我有2个具有相同表及其结构的Sql数据库.

我需要做的是,在每个表中将DB2与DB1的最新记录进行同步.

例如.说DB有Employee Table Emp.

DB1.Emp有6条记录
1-A
2-B
3-C
4-D
5-E
6-F

DB2.Emp有4条记录
1-A
2-B
3-C
4-D

我希望将DB1.Emp中的2条记录插入DB2.Emp

我知道我可以使用VB.net遍历DB1中的每个表记录并将其插入DB2中来做到这一点.

但是他们是通过其他任何方式,还是在sql server中命令批量复制此数据.

任何帮助都将非常有用.

Hello, this is Vikash.

I have 2 Sql Databases with Identical tables and their structures.

What I need to do is, Synchronise DB2 with latest records from DB1, in each table.

eg. Say DB has Employee Table Emp.

DB1.Emp has 6 records
1-A
2-B
3-C
4-D
5-E
6-F

DB2.Emp has 4 records
1-A
2-B
3-C
4-D

I want the 2 records in DB1.Emp get inserted in DB2.Emp

I know I can do this using VB.net looping through each tables record in DB1 and inserting into DB2.

But is their any other way, or command in sql server to bulk copy this data.

Any help would be great.

推荐答案

SQL复制 [ ^ ]将如果DB2是DB1的子代,则执行此操作
SQL Replication[^] will do that if DB2 is a child of DB1


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

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