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

Execute Script Dialog

Opened to review and run script for merge, replace and delete actions performed using merge to right, merge to left, replace to right, replace to left, delete left and delete right toolbar actions.

It is opened from Object list, Table structure diff and View definition diff tabs to review scripts for processed database objects:

for SQL Server, execute script dialog

Dialog content:

Please review the merge script below and click Run to execute this script.
Target database: {Database display name}
Merge script: Copy to clipboard  Save to file
(script)
Execution result: Copy to clipboard  Save to file
(result)

Dialog header can contain additional warnings:

  • In case of table deletion:
    WARNING!!! You're going to DELETE table(s) COMPLETELY with all their DATA.
    Please make sure you've done a backup if necessary.
  • In case of table table definition change:
    WARNING!!! You're going to alter one or more tables. In some cases it may produce DATA LOSS (for example if column is dropped).
    Please make sure you've done a backup if necessary.
    Some statements may fail because of existing data or foreign key constraints - please check Execution result after completion.
  • Specifically, if any of changed table definitions have changed column order and application is configured to recognize such tables and changed:
    Some of selected changes are caused only by changed column order. Such changes can not be merged and these items will remain changed after completion of merge. You can uncheck 'Columns order' table definitions option in Settings to consider such tables as unchanged.

This dialog is also shown from the Data diff and Batch data diff tabs to review scripts for data merge/delete actions:

for SQL Server, execute data script dialog

Dialog header:

You can review the merge script below and click Run to execute this script or copy it to clipboard/file for later use.
Target database: {Database display name}
Target table: {table}, records to be {merged or deleted}: {count}
Execution status: {status}

In case of data processing, the dialog has additional options:

  • With transaction
    (all changes will be rolled back on cancellation,
    can also make execution much faster)
  • Stop on first error
    (for example - contraint violation, etc.
    if transaction enabled, all changes rolled back)

If processed table has an auto-increment primary key in the target database, this dialog shows additional option:

  • Import existing identity, sequence or other auto-generated primary key values on INSERT
    (if not checked, DB engine will generate new values which most likely will be different)

If it is applicable (shown) and disabled - then even after merge table can still have changes because new rows will get new IDs and will be counted as different rows. Also, if such a primary key is used as a foreign key for any other table, then it can be non-desirable action and you probably need to use Id-Remap merge instead.

Data processing script is splinted into script items per row. The dialog contains additional buttons to scroll thru script items and buttons Copy ALL to clipboard / Save ALL to file for script items and their execution results. Since amount of rows can be bery big, Copy ALL result is limited to 1 million characters.

Run action executes displayed script, information about script execution will be shown in the bottom Execution result text area. If there will be any errors from database engine - they will be shown here as well. Data merge/delete execution result is individual for each script item, total number of errors shown in the Execution status label.

Free Version Limitations

  • Data merge/delete script has no Copy ALL to clipboard and Save ALL to file actions
  • Data row count to be processed is not shown
  • Data merge/delete - no First row/Last row buttons

Last updated: 2025-04-08