Microsoft KB Archive/818334

= Replication setup is not successful when SQL Server is deployed by using a disk image =

Article ID: 818334

Article Last Modified on 5/12/2007

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition
 * 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 Edition

-



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 '< >\< >' as the Distributor for '< >\< >'.

Error 18483: Could not connect to server '< >\< >' 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:   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'  Restart the computer running SQL Server.  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 '< >\< >' dialog box, click Next.
 * 5) In the Select Distributor dialog box, click to select the Make '< >\< >' 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.
 * 1) In the Customize the Configuration dialog box, click to select the No, use the following default settings check box, and then click Next.
 * 2) In the Completing the Configure Publishing and Distribution Wizard dialog box, click Finish.

