You are here: Home / Blog / posts / Programming Magic / SQL Server: Unable to add new replication subscription

SQL Server: Unable to add new replication subscription

by Ken Taylor published Oct 21, 2013 02:35 PM, last modified Jan 28, 2014 11:38 AM
This article describes how to fix broken replication services on a subscriber where a NULL SERVERNAME is the issue.

When trying to add a new Replication Subscription I received the following message:

TITLE: New Subscription Wizard

Microsoft SQL Server Management Studio is unable to access replication components because replication is not installed on this instance of SQL Server. For information about installing replication, see the topic Installing Replication in SQL Server Books Online.

This was true even though I had just added one days before.

This ended up being because I had inadvertently deleted the local server name, which is required by the replication service.

You can check for this by entering the following command in a query window:


It should return the name of the database server, i.e. DONBOT, in this case; however, mine came back with NULL instead.

In order to restore the functionality you must set the local server name by issuing the following command, where the "SERVERNAME" in this case is "DONBOT":

EXEC sp_addserver 'DONBOT', 'LOCAL'

Note that it is the same command used to create a linker server except that "LOCAL" is specified as opposed to the typical linked server parameters.

You can verify that the procedure set the server name by re-executing the SELECT @@SERVERNAME command. It should now return the server name you just set as opposed to NULL as before.

Now try adding a new replication subscription. If a NULL servername was the only issue, the new replication wizard should launch instead of an error message.