Replication Error “SQL Server is unable to connect to server..”

February 25, 2010

If you’re working in SQL Server Replication, you may get this message
SQL Server is unable to connect to server ‘Your server name‘.

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. Specify the actual server name, ‘Another server name‘. (Replication.Utilities)

It always appears as you change the instance name manually or network administrators change the computer name.

Actually your server name still as it’s and not changed with above changes so to avoid getting this message you should write these couple of T-SQL scripts every time you do one or all changes on the instance name

SELECT @@SERVERNAME — you’ll get a strange name, you may didn’t see it before…
sp_dropserver ‘Old server name’ — you got it from pervious select.
sp_addserver ‘SQL server instance name’,’local’ — the name of current instance.
Then, restart the service, and go on you replication work…