Microsoft KB Archive/306608

= BUG: Distribution Agent May Fail with Incorrect Syntax when Table Name Contains Hyphens =

Article ID: 306608

Article Last Modified on 10/16/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition
 * Microsoft SQL Server 7.0 Standard Edition

-



This article was previously published under Q306608



BUG #: 355175 (SHILOH_BUGS)

BUG #: 102004 (SQLBUG_70)



SYMPTOMS
The Replication Distribution Agent may fail with the following error message when the name of the table that is being published contains two consecutive hyphens:

Incorrect syntax near '{'.

For example, when you publish a table that is named table--1, the Distribution Agent may fail when moving commands to the Subscriber.



CAUSE
When the Log Reader builds the stored procedures that are used to apply transactions at the Subscribers, the stored procedure names are not delimited. When the Distribution Agent runs, the hyphens in the stored procedure name are treated as the beginning of a single-line comment. The rest of the stored procedure call is treated as a comment.



WORKAROUND
Rename the tables so that they do not include consecutive hyphens.



STATUS
Microsoft has confirmed this to be a problem in SQL Server 2000.

Microsoft has confirmed this to be a problem in SQL Server 7.0.



MORE INFORMATION
When the Distribution Agent runs, it attempts to call stored procedures in the form of sp_MSxxx_tablename on the Subscriber. The variable &quot;xxx&quot; is either:


 * ins for an INSERT statement.
 * upd for an UPDATE statement.
 * del for a DELETE statement.

The call to the stored procedure by the Distribution Agent looks similar to: {CALL sp_MSupd_table--1 (NULL,'9',1,0x02)} The hyphens are interpreted as a single line comment and the parameters are ignored.

Keywords: kbbug kbpending KB306608

-

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

© Microsoft Corporation. All rights reserved.