Replication setup is not successful when SQL Server is deployed by using a disk image (818334)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Express Edition
  • Microsoft SQL Server 2005 Workgroup

SYMPTOMS

You deploy SQL Server 2000 by using the hard disk image of another computer where SQL Server 2000 is installed. If you use SQL Server Enterprise Manager to configure a replication distributor, the configuration of the distributor may not be successful, and you receive the following error message:
SQL Server Enterprise Manager could not configure '<Server>\<Instance>' as the Distributor for '<Server>\<Instance>' .
Error 18483: Could not connect to server '<Server>\<Instance>' because 'distributor_admin' is not defined as a remote login at the server.

Note If you perform these steps on the default instance of SQL Server 2000, the instance name does not appear in the error message.

You may also see that the value of the @@SERVERNAME SQL Server 2000 system global variable is different from the network name of the SQL Server 2000 computer.

Note If you experience this issue in SQL Server 2005, the error message is slightly different. You can also use the workaround that is mentioned in this article to work around the issue.

CAUSE

When you deploy SQL Server 2000 from a hard disk image of another computer where SQL Server 2000 is installed, the network name of the imaged computer is retained in the new installation. The incorrect network name causes the configuration of the replication distributor to fail. The same problem occurs if you rename the computer after SQL Server is installed.

WORKAROUND

To work around this problem, replace the SQL Server 2000 server name with the correct network name of the computer. To do so, follow these steps:
  1. Log on to the computer where you deployed SQL Server 2000 from the disk image, and then run the following Transact-SQL statement in SQL Query Analyzer:
    -- Use the Master database
    USE master
    GO
    
    -- Declare local variables
    DECLARE @serverproperty_servername 	varchar(100), 
    	@servername 			varchar(100)
    
    -- Get the value returned by the SERVERPROPERTY system function
    SELECT @serverproperty_servername = CONVERT(varchar(100), SERVERPROPERTY('ServerName'))
    
    -- Get the value returned by @@SERVERNAME global variable
    SELECT @servername = CONVERT(varchar(100), @@SERVERNAME)
    
    -- Drop the server with incorrect name
    EXEC sp_dropserver @server=@servername
    
    -- Add the correct server as a local server
    EXEC sp_addserver @server=@serverproperty_servername, @local='local'
  2. Restart the computer running SQL Server.
  3. To verify that the SQL Server name and the network name of the computer are the same, run the following Transact-SQL statement in SQL Query Analyzer:
    SELECT @@SERVERNAME, SERVERPROPERTY('ServerName')

MORE INFORMATION

You can use the @@SERVERNAME global variable or the SERVERPROPERTY('ServerName') function in SQL Server to find the network name of the computer running SQL Server. The ServerName property of the SERVERPROPERTY function automatically reports the change in the network name of the computer when you restart the computer and the SQL Server service. The @@SERVERNAME global variable retains the original SQL Server computer name until the SQL Server name is manually reset.

Steps to Reproduce the Problem

On the computer where you deployed SQL Server from a disk image, follow these steps:
  1. Start SQL Server Enterprise Manager.
  2. Expand SQL Server Group, and then click your SQL Server instance name.
  3. On the Tools menu, point to Replication, and then click Configure Publishing, Subscribers, and Distribution.
  4. In the Configure Publishing and Distribution Wizard for '<Server>\<Instance>' dialog box, click Next.
  5. In the Select Distributor dialog box, click to select the Make '<Server>\<Instance>' its own Distributor; SQL Server will create a distribution database and log check box, and then click Next.
  6. In the Configure SQL Server Agent dialog box, click Next.
  7. In the Specify Snapshot Folder dialog box, click Next.

    Note If you receive a message to confirm the snapshot folder path, click Yes.
  8. In the Customize the Configuration dialog box, click to select the No, use the following default settings check box, and then click Next.
  9. In the Completing the Configure Publishing and Distribution Wizard dialog box, click Finish.

REFERENCES

For more information about disk imaging and SQL Server installations, visit the following Microsoft Web sites:

Modification Type:MajorLast Reviewed:12/13/2005
Keywords:kberrmsg kbReplication kbDeployment kbwizard kbServer kbSysAdmin kbprb KB818334 kbAudDeveloper