Article ID: 936534 - View products that this article applies to.
Bug#: 50001158 (SQL Hotfix)
Consider the following scenario. You configure a transactional replication in Microsoft SQL Server 2005. You create the initial snapshot successfully on the publisher. In this scenario, when the Distribution Agent tries to apply the snapshot to the subscriber, you receive the following error message:
This issue occurs if the following conditions are true:
Error: 137, Severity: 15, State: 2
Must declare the scalar variable "@Variable".
The Distribution Agent creates a stored procedure to insert data on the subscriber. However, the stored procedure has incorrect parameter numbers.
Cumulative update informationThe fix for this issue was first released in Cumulative Update 2. For more information about how to obtain this cumulative update package for SQL Server 2005 Service Pack 2, click the following article number to view the article in the Microsoft Knowledge Base:
936305Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2005 fix release. Microsoft recommends that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
(https://support.microsoft.com/kb/936305/LN/ )Cumulative update package 2 for SQL Server 2005 Service Pack 2
937137Microsoft SQL Server 2005 hotfixes are created for specific SQL Server service packs. You must apply a SQL Server 2005 Service Pack 2 hotfix to an installation of SQL Server 2005 Service Pack 2. By default, any hotfix that is provided in a SQL Server service pack is included in the next SQL Server service pack.
(https://support.microsoft.com/kb/937137/LN/ )The SQL Server 2005 builds that were released after SQL Server 2005 Service Pack 2 was released
To work around this issue, use one of the following methods:
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
For example, this issue occurs when you use the following statement to create the underlying table of the article:
Article ID: 936534 - Last Review: October 8, 2011 - Revision: 2.0