KS DB Merge Tools logo KS DB Merge Tools
Documentation
MssqlMerge logo for SQL Server
aka MssqlMerge
KS DB Merge Tools for Oracle logo
KS DB Merge Tools for MySQL logo
KS DB Merge Tools for PostgreSQL logo
KS DB Merge Tools for SQLite logo
AccdbMerge logo
KS DB Merge Tools for Cross-DBMS logo

Batch Data Merge Dialog

This dialog is opened to confirm and customize the batch data merge/delete action from the Batch data diff tab:

for SQL Server, batch data merge warning

The dialog contains the following explanatory text and configuration options:

Data merge and deletion does not make any backup, please make sure that you've done it yourself if needed.
We're going to prepare data modification scripts. It may take some time. These scripts will be saved in the temporary database on this computer, by default in the application settings folder in your user profile on the system drive. It will require some drive space, proportional to the amount of the data going to be processed. If needed, you can change temporary script folder in the Settings, Data Diff tab.
The next section is shown only if we are going to process tables with changed column definitions:
Some of selected tables have 'Changed columns'=Yes, this means that:
- source table may have columns that are not going to be merged,
- some column data types can be changed, data can be truncated or not merged at all.
The next section is displayed if there are any tables that cannot be merged due to missing or changed key definitions:
Your selection also contains one or more views or tables without common key - they are not going to be processed.
This section is shown only for the Merge action when it relates to the Id-Remap Merge scenario:
Some of selected tables have identity/sequence primary keys and the database contains other tables referencing these primary key values by foreign keys. This means that:
- if we merge the source primary key value as is into the target, then in the target this value can be already used by some other entity and its data will be overwritten,
- if we merge the source foreign key value as is into the target, then this row can be bound to the wrong entity.
To avoid these issues, you can use so-called 'Id-Remap Merge'. Target database will generate new values for these primary keys and we'll create additional mapping tables to keep mapping between source and target id values. When we merge the foreign key values, we'll replace them with newly inserted parent id values using these mapping tables. After operation completion mapping tables can be used to check and troubleshoot the merge result and to rollback/remove this data without need to restore backup.
In case of Id-Remap Merge, all the processed rows are going to be INSERTed into the target, no UPDATEs or DELETEs. The New/Changed rows filter below specify only which rows to take from source, but not how they are going to be processed in the target.
If this scenario is applicable to our merge but cannot be applied due to certain limitations, the dialog describes these limitation errors:
However, the Id-Remap Merge has some limitations related to dependency levels (DLs), particularly:
- the selected tables must have the same DL in the target database. If you want to merge dependent tables (with different DL), you can setup this in the Id-Remap configuration dialog which is opened next if you choose to use Id-Remap Merge
- all the tables in the target database must have DL. It can be missing if your tables organize circular foreign key dependencies. You can try to remove some foreign keys to break the cycle, but you need to keep foreign keys which are important for Id-Remap logic
Please try to fix this to proceed with Id-Remap Merge.
You can find more information about table dependency levels on the appropriate help page, and more information about why it is necessary for Id-Remap in the Id-Remap Merge dialog help page.

Otherwise, the dialog suggests using the Id-Remap Merge.

The next section displays the target database and asks for a desired new/changed rows filter to apply:

Target database: {Database display name}
Please specify which rows should be {merged or deleted} to the target database:

with mutually exclusive options to process New, Changed, or New and changed rows. If we use Id-Remap Merge, this option also allows processing All rows. If we are performing a regular merge (neither a deletion nor an Id-Remap Merge), then the options for Changed and 'New and Changed' provide an additional option to update only changed values:

If the generated script will contain UPDATE statements, it can include all or only changed column values. In the last case, script will not be generated for unchanged rows.

The default value for this option can be configured in the Settings dialog under the Data Diff tab.

In the case of a non-Id-Remap merge with a 'New and Changed' filter, the dialog also suggests generating DELETE script items to ensure that the target rows match the source rows exactly:

It seems that you want to merge all changes to the target db. By default this option inserts missing rows and updates changed rows. However the target table may contain rows which are missing in the source and this will keep the set of rows different even after completion of merge. You can eliminate these changes in two ways: 1) after completion of Merge action run Delete action on the target db, or 2) select the option below:
Delete new rows in the target database

Free version limitations:

  • The whole dialog is not available

Last updated: 2025-01-27