If you try to register the server (Publisher or the Subscriber) by using an IP address instead of a client alias or if the client alias is different from the actual SQL Server NetBIOS name, the Merge Agent may fail and you receive this error. See article ME321822
- Use the Master database:
- Declare local variables:
DECLARE @serverproperty_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’
See article ME818334
Note: You may not have to reinstall Microsoft SQL Server to resolve this problem.
1. Log on by using an account that has administrative credentials.
2. Click Start click Programs click Microsoft SQL Server and then click Query Analyzer.
3. In the Connect to SQL Server dialog box click (local) in the SQL Server list and then click OK.
4. In SQL Query Analyzer type the following code:
sp_addserver ‘new_name’ ‘local’
Note: In this code, old_name is a placeholder for the old name of the computer and new_name is a placeholder for the new name. Type the actual old name and new name instead of these placeholders.
5. Click Execute Query (F5) to run the query.
6. Quit SQL Query Analyzer.
Note: After you run the sp_addserver stored procedure you must restart the SQL Server service for the change to take effect. After the server is restarted confirm that the correct value of the new server name is returned by executing the following commands in Query analyzer:
Select @@servername Select ServerProperty('machinename')
The names returned should match in spelling and case.
See article ME899159
In my case, I used solution B and the problem was solved.