Edit

Bulk-load data into tables in a merge publication

Applies to: SQL Server

When you load data into tables by using the bcp Utility or the BULK INSERT command, merge replication triggers that keep tracking data in the MSmerge_contents system table don't fire by default. You can either force the merge replication triggers to fire as you load the data or insert the generated replication metadata programmatically after the bulk copy operation by using replication stored procedures.

To bulk-load data into tables published by merge replication using the bcp utility

  1. At either the Publisher or Subscriber, run the bcp Utility or BULK INSERT to insert data into a table published by merge replication.

  2. Use one of the following methods to ensure that replication metadata is generated for the inserted data:

    • Run the bulk copy operation by using the FIRE_TRIGGERS option.

    • On the database where you inserted data, run sp_addtabletocontents (Transact-SQL). Specify the table name where you inserted the data for @table_name.