The sp_MSinitDynamicSubscriber stored procedure is called more than one time by using the same parameters when you synchronize a merge subscription in SQL Server 2005 (917476)



The information in this article applies to:

  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Workgroup
  • Microsoft SQL Server 2005 Mobile Edition

Bug number: 430861(SQLBUDT)

SYMPTOMS

Consider the following scenario. You create a merge publication that has parameterized filters in Microsoft SQL Server 2005. You then try to synchronize a subscriber. You use SQL Server Profiler to trace the instance of the publisher. In this scenario, you may notice that the sp_MSinitDynamicSubscriber stored procedure is called more than one time by using the same parameters.

Note This problem may also occur when you use a SQL Server 2005 Everywhere subscriber.

CAUSE

This problem occurs because SQL Server calls the sp_MSinitDynamicSubscriber stored procedure to download all initial data for each batch of generations.

WORKAROUND

To work around this problem, create a partitioned snapshot for the merge publication that has parameterized filters. For more information about how to do this, visit the following Microsoft Developer Network (MSDN) Web site:Note In merge replication, a snapshot includes only the data from a single partition. A partitioned snapshot is used to initialize subscriptions to publications that have parameterized filters. A partitioned snapshot is referred to as a dynamic snapshot in earlier versions of SQL Server.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

A generation is a collection of changes that is delivered to a publisher or to a subscriber. Generations will be processed in batches when changes are downloaded from the publisher to the subscriber. The DownloadGenerationsPerBatch argument of the Replication Merge Agent is the number of generations to be processed in a single batch.

When you synchronize a merge subscription, SQL Server will call the sp_MSinitDynamicSubscriber stored procedure on the publisher if no partitioned snapshot is created for the merge publication. If you have many batches, the sp_MSinitDynamicSubscriber stored procedure is incorrectly called for each batch of generations.

When the number of generations on the publisher is less than the DownloadGenerationsPerBatch value, only one batch is generated. Therefore, this problem does not occur. If you have multiple batches, the sp_MSinitDynamicSubscriber stored procedure will be called multiple times by using the same parameters.

Modification Type:MajorLast Reviewed:4/25/2006
Keywords:kbsql2005repl kbExpertiseAdvanced kbprb KB917476 kbAudDeveloper kbAudITPRO