MsiDatabaseMerge

[This is preliminary documentation and subject to change.]

The MsiDatabaseMerge function merges two databases together, allowing duplicate rows.

UINT MsiDatabaseMerge(
  MSIHANDLE hDatabase,      // database handle
  MSIHANDLE hDatabaseMerge, // database to be merged into hDatabase
  LPCTSTR szTableName       // name of persistent table to receive rows
);
 

Parameters

hDatabase
Handle to the base database.
hDatabaseMerge
Handle to the database to merge into the base database.
szTableName
Specifies the name of the table to receive merge conflict information.

Return Values

ERROR_FUNCTION_FAILED
Merge conflicts were reported.
ERROR_INVALID_HANDLE
An invalid or inactive handle was supplied.
ERROR_INVALID_TABLE
An invalid table was supplied.
ERROR_SUCCESS
The function succeeded.

Remarks

The MsiDatabaseMerge function merges two databases. The data in the base database dominates in any merge conflicts. If tables of the same name in both databases do not match in the number of primary keys, column types, number of columns, or column names, or if the tables share the same primary key names but the data in the other columns differs, the MsiDatabaseMerge function fails. If merge conflicts are reported, the Error table that is created contains two columns. The first column specifies the name of the table that has merge conflicts. The second column contains the number of rows in the table that has merge conflicts.

QuickInfo

  Windows NT: Requires version 4.0 or later. Available as a redistributable for Windows NT 4.0.
  Windows: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in msiquery.h.
  Import Library: Use msi.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also

Database Access Reference, Database Management Functions