Monday, March 1, 2010

Server Name Mismatch

When I was configuring replication at a customer site today, I came across a problem where the internal name of a SQL Server didn’t match the machine name. I replicated (ha!) the problem on my laptop:

image

The message reads: “SQL Server replication requires the actual server name to make a connection to the server. Connections through a server alias, IP address or any other alternate name are not supported.”

To fix this problem, check the values of:

select serverproperty ('servername')

and

select @@SERVERNAME

As indicated in the error message, you will most likely find that they return different values. This is enough to confuse your Configure Distribution Wizard. I then used:

sp_dropserverincorrect_server_name’

sp_addservercorrect_server_name’, local

And restarted the SQL service for good measure. More info on these procs is available in books online.

In my case, the problem was caused by the SQL Server having been built from a dodgy machine image, and the windows server having been subsequently renamed. Something to be aware of when renaming a server!

No comments: