Microsoft KB Archive/917476

= 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 =

Article ID: 917476

Article Last Modified on 12/7/2006

-

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 Edition
 * Microsoft SQL Server 2005 Compact 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:

http://msdn2.microsoft.com/en-us/library/ms151260.aspx

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 &quot;Applies to&quot; 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.

Keywords: kbsql2005repl kbexpertiseadvanced kbprb KB917476

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.