Replication and Invalid SQL Server Names

In SQL Server 6.0, replication to and from servers with Windows NT-based computers that are invalid SQL Server names is not supported. (For example, names with hyphens are invalid SQL Server names). The reason for this is that in SQL Server 6.0, replication uses the srvname column in the sysservers system table, and entries in this column need to be valid SQL Server names.

SQL Server 6.5 relaxes this restriction by using the srvnetname column in sysservers instead.

    To set up an invalid SQL Server name as a publisher, distributor, or publisher/distributor
  1. In the SQL Client Configuration utility, in the Advanced dialog box, create a DB-Library alias from a valid server name to the Windows NT-based machine name. For example, if the machine name is new-server-name (with invalid hyphens), the client configuration information will be:
Server: new_server_name
DLL: Named pipes
Connection string: new-server-name

For more information, see the Microsoft SQL Server Administrator's Companion.

  1. In SQL Enterprise Manager, from the Server menu, register the server using the alias defined in step 1.

    For example, register the server as new_server_name.

    Note that you will not be able to start and stop SQL Server or SQL Executive from SQL Enterprise Manager. You can use SQL Service Manager. Also, you will be unable to view the SQL Executive icon. View SQL Executive tasks via the Server menu/Scheduled Tasks selection in SQL Enterprise Manager.

  2. Using stored procedure sp_addserver, create a local server name for SQL Server that matches the server alias created in step 1, as follows:
    sp_addserver new_server_name, LOCAL
      

    where

    new_server_name
    Specifies a logical server name to replace the invalid server name.
    LOCAL
    Specifies the server is on the local machine.
  3. Start SQL Server.
  4. In SQL Enterprise Manager, from the Server menu, choose Replication Configuration/Install Publishing.

    Complete the Install Replication Publishing dialog box that appears.

  5. In SQL Enterprise Manager, from the Server menu, choose Replication Configuration/Publishing.

    The Replication - Publishing dialog box appears.

  6. In the Working Directory box, type the network machine name; it will be using the registered server name.
  7. In SQL Enterprise manager, create publications and articles on the publisher. You can also use stored procedures to create publications and articles.
  8. With SQL Enterprise Manager focus set on a subscribing server, set the publisher's srvnetname on the subscriber as follows:
    sp_setnetname new_server_name, 'new-server-name'
      

    where

    new_server_name
    Is the server alias for the publisher that was defined on the subscriber by SQL Enterprise Manager.
    new-server-name
    Is the invalid machine name.
  9. Enable subscribing from the publishing server.

    You can now create either push or pull subscriptions.

    To set up an invalid SQL Server name as a subscriber
  1. Change the SQL Server name by using the stored procedure sp_addserver, as follows:
    sp_addserver new_server_name, LOCAL
      

    where

    new_server_name
    Specifies a logical server name to replace the invalid server name.
    LOCAL
    Specifies the local machine.
  2. Restart SQL Server.
  3. From SQL Enterprise Manager, add a subscriber using the logical name (for example, new-server-name) on the Publisher/Distributor.
  4. Set the subscriber's srvnetname on the Publisher/Distributor by using:
    sp_setnetname new_server_name, 'new-server-name'
      

    where

    new_server_name
    Specifies a logical server name to replace the invalid server name.
    new-server-name
    Specifies the real machine name, which contains hyphens in this example.
  5. Create publications and articles on the publisher.
  6. Create push or pull subscriptions.

For more information on replication, see the Microsoft SQL Server Administrator's Companion.