BUG: Distribution Agent May Fail with Incorrect Syntax when Table Name Contains Hyphens (306608)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)
  • Microsoft SQL Server 7.0

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 "xxx" 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.

Modification Type:MajorLast Reviewed:10/16/2003
Keywords:kbbug kbpending KB306608