Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Bulk-Load Data into Tables in a Merge Publication (Replication Transact-SQL Programming)

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

When data is loaded into tables using the bcp Utility or the BULK INSERT command, by default, the merge replication triggers that maintain tracking data in the MSmerge_contents system table are not fired. You can either force the merge replication triggers to fire as the data is loaded, or you can insert the generated replication metadata programmatically after the bulk copy operation 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, execute the bcp Utility or BULK INSERT to insert data into a table published using merge replication.

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

    • Execute the bulk copy using the FIRE_TRIGGERS option.

    • On the database into which data was inserted, execute sp_addtabletocontents (Transact-SQL). Specify the table name into which the data was inserted for @table_name.

Community Additions

ADD
Show:
© 2015 Microsoft