Merge Method

[This is preliminary documentation and subject to change.]

This is the Merge method of the MsiDatabase object. This method merges the reference database with the base database.

Syntax

object.Merge reference, errorTable

Parts

object
MsiDatabase object.
reference
Required MsiDatabase object to be merged into the base.
errorTable
Optional name of a table to contain the names of the tables containing merge conflicts, the number of conflicting rows within the table, and a reference to the table with the merge conflict.

Remarks

If no table is provided, the general error message provides the number of tables containing merge conflicts. Any table can be passed in, but all other columns must be nullable since the operation to update the Error table fails if a column is not nullable. A newly created table can be passed in as well since the Merge method automatically creates the columns it uses if merge conflicts are found. Two columns are used for presenting merge conflicts. The first column is the table name and the primary key column. The second column is the number of rows of that table that have merge failures.

If tables of the same name in both databases do not match in the number of primary keys, the column types, the number of columns, or the column names, the Merge method fails and posts an error message stating what occurred.

For the Error table to remain, the error handler must commit the database to which the Error table belongs. However, this commit should be done after using the third column to obtain the references to those tables where merge conflicts occurred.