When working with SQL Server replication and you try to add a new subscription under a local publication, under certain circumstances you might end up with the error message: Cannot connect to … SQL Server replication requires the actual server name to make a connection to the server. Specify the actual server name (Replication.Utilities).
Why do you get this Error?
The reason for which you get the above error message, most probably has to do with the fact that even though you provide the “correct” instance name in the subscriber connection dialog, the internal server name in the sys.servers system table of your instance, is probably wrong.
This might happen for example, in case where you renamed the network name of the SQL Server instance, without properly following the official procedure as described in MS Docs, that involves also calling certain system stored procedures.
How to Resolve the Issue
Read on below, in order to see how you can resolve the issue, if the scenario you are encountering is the same like the one described above and you get the exact error message: SQL Server replication requires the actual server name to make a connection to the server. Specify the actual server name (Replication.Utilities).
Step 1: Check the instance name registered in sys.servers
The first thing to do for resolving the issue, is to execute the below T-SQL statement against your instance, in order to retrieve the instance name, as it is stored in the sys.servers system table:
SELECT @@SERVERNAME; GO
Step 2: If the instance name returned in Step 1 is not the correct one
If the above query returns a SQL Server instance name which is not the actual name of your instance, then you will have to rename it to the correct one.
So, for example, based on the official Microsoft procedure, for a renamed standalone computer that hosts a default instance of SQL Server, you modify accordingly and run the below T-SQL script:
EXEC sp_dropserver '<old_name>'; GO EXEC sp_addserver '<new_name>', local; GO
Similarly, for a renamed standalone computer that hosts a named instance of SQL Server, you modify accordingly and run the below T-SQL script:
EXEC sp_dropserver '<old_name\instancename>'; GO EXEC sp_addserver '<new_name\instancename>', local; GO
Right after you properly rename the SQL Server instance, you need to restart the instance.
After restarting the instance, you may try again to add the subscription.
Hope this helps!
Strengthen your SQL Server Administration Skills – Enroll to our Online Course!
Check our online course on Udemy titled “Essential SQL Server Administration Tips”
(special limited-time discount included in link).
Via the course, you will learn essential hands-on SQL Server Administration tips on SQL Server maintenance, security, performance, integration, error handling and more. Many live demonstrations and downloadable resources included!
Featured Online Courses:
- Introduction to Azure SQL Database for Beginners
- Introduction to Azure Database for MySQL
- SQL Server 2019: What’s New – New and Enhanced Features
- SQL Server Fundamentals – SQL Database for Beginners
- Essential SQL Server Administration Tips
- Boost SQL Server Database Performance with In-Memory OLTP
- Essential SQL Server Development Tips for SQL Developers
- Working with Python on Windows and SQL Server Databases
- Introduction to Computer Programming for Beginners
- .NET Programming for Beginners – Windows Forms with C#
- Introduction to SQL Server Machine Learning Services
- Entity Framework: Getting Started – Complete Beginners Guide
- How to Import and Export Data in SQL Server Databases
- Learn How to Install and Start Using SQL Server in 30 Mins
- A Guide on How to Start and Monetize a Successful Blog
Related SQL Server Administration Articles:
- [DBNETLIB] [ConnectionOpen (SECDoClientHandshake()).] SSL Security Error – How to Resolve
- Essential SQL Sever Administration Tips
- There is not enough space on the disk. (mscorlib)
- How to Patch a Standalone SQL Server Instance
- The SQL Server Browser Service and UDP Port 1434
- The Maximum Number of Concurrent Connections Setting in SQL Server
- Top 10 SQL Server DBA Daily Tasks List
- There is no SQL Server Failover Cluster Available to Join
- Encrypting a SQL Server Database Backup
Rate this article:
Reference: SQLNetHub.com (https://www.sqlnethub.com)
Artemakis Artemiou is a Senior SQL Server Architect, Author, a 9 Times Microsoft Data Platform MVP (2009-2018). He has over 15 years of experience in the IT industry in various roles. Artemakis is the founder of SQLNetHub and TechHowTos.com. Artemakis is the creator of the well-known software tools Snippets Generator and DBA Security Advisor. Also, he is the author of many eBooks on SQL Server. Artemakis currently serves as the President of the Cyprus .NET User Group (CDNUG) and the International .NET Association Country Leader for Cyprus (INETA). Moreover, Artemakis teaches on Udemy, you can check his courses here.