Replication

Queued Updating Considerations

When using queued updating, consider the following:

Modifying Data at the Subscriber

When modifying published data at the Subscriber, consider the following:

For example, if a row has a value of 'Bill' in the primary key column, and that value is updated to be 'William' at the Publisher and to 'Will' at the Subscriber, both the publication database and the subscription database will end up with two rows (one with the primary key 'William', and the other with the primary key of 'Will'). It is recommended to restrict primary key updates to a single site (for example, you could restrict primary key updates by adding an update trigger at the Subscriber that prevents updates to columns participating in the primary key. The trigger could be added to any necessary Subscribers by using script execution before or after applying the initial snapshot). 

Manual Initial Synchronization of a Queued Updating Subscription

If you subscribe to a transactional publication that allows queued updating subscriptions, but you do not have the subscription initialized automatically by SQL Server, all of the objects (custom stored procedures, change tracking triggers, and conflict table) will not be created. You will need to create them manually with the following steps:

  1. Script the creation of the table at the Publisher, and using that script, create the table in the subscription database. If you create the script manually, include the primary key constraint.

  2. In the publication database, execute the following stored procedures:
    • sp_scriptinsproc (specify the @article_id parameter).

    • sp_scriptxupdproc (specify the @article_id parameter).

    • sp_scriptxdelproc (specify the @article_id parameter).

These will generate scripts for custom stored procedures to be applied to the subscription database. Execute these scripts in the subscription database. The article ID value can be obtained by executing sp_helparticle.

  1.  In the publication database, execute the following system stored procedure:
    • sp_makeconflicttable (specify the @publication and @article parameters).

This stored procedure returns 0 if successful and 1 if not successful. This generates a script for the conflict table for the given article. Execute this script in the subscription database.

  1. At the Subscriber, execute the following system stored procedure: