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

Batch Data Merge Dialog

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

for SQLite, batch data merge warning

Once the confirmation is OK, the next step is typically script generation and the Execute script dialog (see below for exclusions related to Id-Remap and 'Update changed only' scenarios).

The dialog contains the following sections.

Action

Section content:
Data merge and deletion does not make any backup, please make sure that you've done it yourself if needed.
Target database:
{Database display name}
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 warning 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 warning 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.

Id-Remap Merge

This section is shown only for the merge action when it relates to the Id-Remap Merge scenario:
Some of selected tables have AUTOINCREMENT primary keys and the database contains other tables referencing these primary key values by foreign keys.
- 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.
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 Id-Remap Merge can be applied, this text is followed by the option to enable it:
Use Id-Remap Merge
In this case, the next step in our merge execution flow will be the Id-Remap Merge dialog to set up additional configuration for Id-Remap Merge.
If this scenario is related to our merge but cannot be applied due to certain limitations, the dialog describes these limitation errors:
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 that needs to be merged must have DL in the target database. Selected parent tables must have at least one child with DL. DL 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.
This expander control includes only errors related to the current merge operation. 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.

Scope and script options

This section asks for a desired new/changed rows filter to apply and allows to specify options related to that filter.
Please specify which rows should be {merged to or deleted in} the target database:
New  ○ Changed  ○ New and changed  ○ All

Option All is available only for Id-Remap Merge.

If we are performing a regular merge (neither a deletion nor an Id-Remap Merge), then we may have additional options for script generation.

New and 'New and Changed' options provide an additional option for AUTOINCREMENT column values:

Some of selected tables have AUTOINCREMENT primary keys. If the following option is disabled, DB engine will generate new values which most likely will be different
Import existing AUTOINCREMENT values on INSERT

Changed and 'New and Changed' options 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.
Update only changed columns

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

Transactions

Section content:
Wrap table data operations in a transaction. Can also provide better performance.
With transaction
If enabled, the generated script is wrapped with BEGIN TRANSACTION and COMMIT statements.

Free Version Limitations

  • The whole dialog is not available

Last updated: 2025-06-06