FIX: Distribution Agent Fails with "Invalid Distribution Command" Error Message (308804)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q308804
BUG #: 355103 (SHILOH_BUGS)

SYMPTOMS

When you add a new column to an existing article, if you press ENTER after the column definition before you click OK, the next time the Distribution Agent runs, it fails with this error message:
Invalid Distribution Command
The last command in the Distribution Agent is:
if not exists (select * from syscolumns where name=N'sam2' and id = object_id('[authors]')) 
begin 
if exists (select * from sysobjects where name=N'syspublications') 
if exists (select * from sysarticles where objid=object_id('[authors]')) exec sp_repladdcolumn @source_object=N'[authors]',@column=N'newcol1',@typetext=N'char(10)
DEFAULT ''''' 
else alter table [authors] add [newcol1] char(10)
DEFAULT ''
else alter table [authors] add [newcol1] char(10)
DEFAULT ''
end 

				
The transaction sequence number and command ID of the last execution batch are 0x000000060000013D004E00000000 and 1.

CAUSE

The Distribution Agent does not handle white space characters (that is, a tab, a new line, or a carriage-return) as a valid part of a command.

RESOLUTION

To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

This problem was first corrected in Microsoft SQL Server 2000 Service Pack 2.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a transactional publication with the authors table as an article.
  2. Create a subscription.
  3. Start the Snapshot Agent.
  4. After you apply the Snapshot Agent, click Publication Properties, point to Filter Columns, and then click Add Column. Add a column named newcol1 to the article with a column definition of:
    char(10)
    DEFAULT ''
    					
  5. Press ENTER.
  6. Click OK. When the Distribution Agent runs, it fails with the error message:
    Invalid Distribution Command

Modification Type:MajorLast Reviewed:10/16/2003
Keywords:kbbug kbfix KB308804