Article ID: 936534 - Last Review: August 20, 2007 - Revision: 1.3 FIX: Error message when the Distribution Agent tries to apply the snapshot to the subscriber in SQL Server 2005: "Must declare the scalar variable "@Variable""Bug#: 50001158 (SQL Hotfix) On This PageSYMPTOMS 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: Error: 137, Severity: 15, State: 2
Must declare the scalar variable "@Variable".
CAUSEThe Distribution Agent creates a stored procedure to insert data on the subscriber. However, the stored procedure has incorrect parameter numbers. RESOLUTIONCumulative 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:936305
(http://support.microsoft.com/kb/936305/LN/
)
Cumulative update package 2 for SQL Server 2005 Service Pack 2 Note 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:937137
(http://support.microsoft.com/kb/937137/LN/
)
The SQL Server 2005 builds that were released after SQL Server 2005 Service Pack 2 was released
Microsoft 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.
WORKAROUNDTo work around this issue, use one of the following methods:
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. MORE INFORMATIONFor example, this issue occurs when you use the following statement to create the underlying table of the article: APPLIES TO
| Article Translations
|
Back to the top
