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

Clean Up Merge Metadata (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).

Merge replication metadata is cleaned up periodically by the Merge Agent based on the retention setting for the publication. This occurs at the Publisher and Subscriber in the MSmerge_genhistory, MSmerge_contents, MSmerge_tombstone, MSmerge_past_partition_mappings, and MSmerge_current_partition_mappings system tables. You can also programmatically clean up the data in these tables using replication stored procedures.

To manually clean up merge metadata

  1. At the Publisher on the publication database, execute sp_mergemetadataretentioncleanup.

  2. (Optional) Note the number of rows removed in step 1 from the MSmerge_genhistory, MSmerge_contents, and MSmerge_tombstone system tables, returned respectively in the @num_genhistory_rows, @num_contents_rows, and @num_tombstone_rows output parameters.

  3. Repeat steps 1 and 2 at the Subscriber to clean up metadata on the subscription database.

Community Additions

ADD
Show:
© 2015 Microsoft