PRB: You Cannot Create a Replication Publication If an Article Name Contains a Special Character (829746)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

SYMPTOMS

When you try to create a new replication publication that includes a table or a stored procedure whose name contains a special character, the publication creation may not be successful, or the publication may be created without the article that contains the special character. For example, the following special characters may cause this problem:
  • *
  • <
  • >
  • ?
  • /
  • \
  • %
  • |
  • :
  • "
  • '
If you use SQL Server Enterprise Manager to create the publication, you may receive the following error message:
SQL Server Enterprise Manager could not create article '<Article Name>' based on object '<Object Name>'.

Do you want to continue saving other changes to the publication?

Error 15006: '<Object Name>' is not a valid name because it contains invalid characters.
Note If you click Yes in the message box, the publication is created. However, the article for the object whose name contains the special character is not available in the list of articles in the publication.

If you use the sp_addarticle system stored procedure to add an article whose name contains a special character, the article may not be added, and you may receive the following error message:
Server: Msg 15006, Level 16, State 1, Procedure sp_MSreplcheck_name, Line 49 '<objectName>' is not a valid name because it contains invalid characters.

CAUSE

This problem occurs because Microsoft SQL Server 2000 does not permit the special characters that are mentioned in the "Symptoms" section of this article to be included in the article name of a replication publication.

WORKAROUND

To work around this problem, remove the special characters from the default article name that is provided by SQL Server 2000. To do so, use one of the following methods:

Method 1

If you use the Create Publication Wizard in SQL Server Enterprise Manager, follow these steps:
  1. Open SQL Server Enterprise Manager.
  2. Expand SQL Server Group, and then click your instance of SQL Server.
  3. On the Tools menu, point to Replication, and then click Create and Manage Publications.
  4. In the Create and Manage Publications on <Instance of SQL Server> dialog box, click Create Publication.
  5. Click Next.
  6. In the Choose Publication Database dialog box, click your test database in the Databases list.
  7. In the Select Publication Type dialog box, accept the default option, and then click Next.
  8. In the Specify Subscriber Types dialog box, click Next.
  9. In the Specify Articles dialog box, click the object type, Tables or Stored Procedures, or both, in the Object Type list.
  10. In the Objects List box, click the object that you want to include in the publication.
  11. Click the ellipsis button next to the selected object.
  12. In the Table/Stored Procedure Article Properties - <Article Name> dialog box, click the General tab.
  13. In the Name text box, remove the special characters from the article name.
  14. Click OK.
  15. In the Specify Articles dialog box, click Next.
  16. Follow the instructions in the Create Publication Wizard to finish creating the new publication.

Method 2

If you use the sp_addarticle system stored procedure to add an article to an existing publication, provide an article name that does not contains a special character. You can do so by using the @article parameter of the sp_addarticle system stored procedure.

MORE INFORMATION

Steps to Reproduce the Problem

To reproduce the problem, follow these steps:
  1. Using SQL Query Analyzer, run the following Transact-SQL statement on your SQL Server test database:
    CREATE TABLE [sample*table] (col1 int)
  2. Open SQL Server Enterprise Manager.
  3. Expand SQL Server Group, and then click your instance of SQL Server.
  4. On the Tools menu, point to Replication, and then click Create and Manage Publications.
  5. In the Create and Manage Publications on <Instance of SQL Server> dialog box, click Create Publication.
  6. Click Next.
  7. In the Choose Publication Database dialog box, select your test database from the Databases list.
  8. In the Select Publication Type dialog box, accept the default option, and then click Next.
  9. In the Specify Subscriber Types dialog box, click Next.
  10. In the Specify Articles dialog box, click Tables in the Object Type list.
  11. In the Objects List box, click the sample*table object.
  12. Click Next.
  13. In the Select Publication Name and Description dialog box, click Next.
  14. In the Customize the Properties of the Publication dialog box, click the No, create the publication as specified option, and then click Next.
  15. In the Completing the Create Publication Wizard dialog box, click Finish.

    Note You may receive one of the error messages that are mentioned in the "Symptoms" section of this article.

REFERENCES

For additional information about the sp_addarticle system stored procedure, visit the following Microsoft Web site:

Modification Type:MajorLast Reviewed:11/18/2003
Keywords:kbReplication kberrmsg kbprb KB829746 kbAudDeveloper