合并两个数据库

问题描述:

我有两个不同的mssql数据库,它们具有相同的架构,但一个系统上的数据不同.我想通过将一个数据库中的数据添加到另一个数据库中来合并两个数据库中的数据.

I have two distinct mssql databases with identical schemas but different data on one system. I want to merge the data between the two databases by adding the data from one into the other.

我尝试使用Redgate Data Compare,但是找不到任何说明.

I tried to use Redgate Data Compare but couldn't find any instructions how to do it.

是否有任何工具(或具有内置工具的数据库)或说明使这项工作相当简单?

Are there any tools (or databases that have built-in tools) or instructions to make this job fairly simple?


xSQL软件为此类型开发了一套工具数据库操作.您可以使用 xSQL数据比较.要获得结果,您需要指定左侧和右侧数据库,进行比较,然后将左侧数据库中缺少的数据添加到右侧数据库中,您需要取消选中右侧行的同步,并生成并执行脚本.
在这里,您可以看到未选中的行:

如您所见,该脚本不会生成任何DELETE语句,而只会为右侧数据库中缺少的行生成INSERTS

希望这可以帮助!
披露:我隶属于xSQL软件


xSQL Software has developed a set of tools for this type of database operations. You can use xSQL Data Compare. To achieve the result you require you specify the left and right database, do the compare and then, to add the data that are missing from the left db to the right db you need to uncheck sync for the right rows and generate and execute the script.
Here you can see the rows unchecked:

And as you can see, the script does not generate any DELETE statements, only INSERTS for the rows that are missing on the right DB

Hope this helps!
Disclosure: I'm affiliated to xSQL Software