SQL Server Error 1452: Fix Partner Server Instance Name
In this article
SQL Server Error 1452 occurs when the partner server instance name provided during the configuration of a database mirror or availability group is incorrect, missing, or does not match the actual network name of the remote server. To fix this, you must ensure that the partner server is defined as a linked server or a known remote instance using its exact network name (FQDN or NetBIOS name) as recognized by the local SQL Server instance.
What You'll Need
- Administrative access (sysadmin role) to both the primary and mirror/partner SQL Server instances.
- The exact network name or Fully Qualified Domain Name (FQDN) of the partner server.
- SQL Server Management Studio (SSMS) installed on the machine managing the configuration.
- Network connectivity between the two servers on the required ports (typically TCP 1433 for the engine and 5022 for mirroring).
Step-by-Step
- Verify the Partner Server Network Name: Log into the partner server. Open a command prompt and type
hostnameto get the short name, or useipconfig /allto find the Fully Qualified Domain Name (FQDN). Note this name exactly; SQL Server is sensitive to mismatches between the name used in the command and the name the server believes it has. - Test Connectivity from the Primary Server: Go to the primary server and open a command prompt. Use the
ping [PartnerServerName]command to ensure the primary server can resolve the partner's name to an IP address. If the ping fails, you must resolve the DNS issue or add an entry to the local HOSTS file before proceeding. - Check SQL Server Browser Service: Ensure the SQL Server Browser service is running on the partner server. This is critical if you are using a named instance (e.g., ServerName\InstanceName) rather than a default instance, as the Browser service directs the connection to the correct dynamic port.
- Configure the Mirroring Endpoint: On both servers, ensure the mirroring endpoints are created and started. Use a T-SQL script to verify the state:
SELECT name, state_desc FROM sys.database_mirroring_endpoints;. If the endpoint is stopped, useALTER ENDPOINT [EndpointName] STATE = STARTED;. - Execute the Mirroring Command with the Correct Name: When initiating the mirroring process via T-SQL, use the exact name verified in Step 1. For example:
ALTER DATABASE [YourDatabase] SET PARTNER = 'TCP://PartnerServerName.domain.com:5022';. Do not use the local server name or an alias unless that alias is globally resolved via DNS. - Validate the Partner Instance: If you continue to receive Error 1452, check if the partner instance is recognized as a valid server. Run
SELECT * FROM sys.servers;. If the partner server is not listed and you are using linked server logic for the connection, add it usingsp_addlinkedserver. - Set the Mirroring State: Once the partner is correctly identified and the connection is established, finalize the setup by running
ALTER DATABASE [YourDatabase] SET PARTNER SAFETY LEVEL = FULL;to ensure data integrity.
Common Mistakes
One of the most frequent mistakes is using the Local Server Name instead of the Network Name. If a server was renamed after the SQL Server installation, the @@SERVERNAME global variable may still reflect the old name, while the network identifies it by the new name. This discrepancy often triggers Error 1452 because the partner instance is reporting a name that the primary server does not recognize as the intended partner.
Another common error is the omission of the Instance Name when dealing with named instances. If your partner server is not a default instance, simply providing the server name is insufficient. You must provide the format ServerName\InstanceName. However, in the connection string for mirroring endpoints, the port number (e.g., 5022) is used instead of the instance name, which often confuses administrators who try to mix the two formats.
Incorrect Permissions are also a major pitfall. The SQL Server service account on the primary server must have permission to connect to the endpoint on the partner server. If you are not using Active Directory integrated security, you must create corresponding SQL Server logins on both instances and associate them with the endpoints using the CREATE LOGIN and GRANT CONNECT commands.
Tips
To avoid DNS-related naming issues, always prefer using the Fully Qualified Domain Name (FQDN). While short names work in small environments, FQDNs prevent ambiguity in multi-domain or hybrid-cloud setups where the same short name might exist in different namespaces.
Use SQL Server Management Studio (SSMS) for the initial setup if you are uncomfortable with T-SQL. Right-click the database, select Tasks > Mirror, and use the wizard. The wizard often provides more immediate feedback on whether the partner instance name is being rejected during the connection phase.
Keep a Configuration Log. Document the exact port numbers, service account names, and FQDNs used for both the primary and partner instances. When troubleshooting Error 1452, having a record of exactly what was typed into the SET PARTNER command allows you to spot typos or casing errors that might be causing the failure.
Troubleshooting
If you have verified the names and are still seeing Error 1452, start by checking the SQL Server Error Logs on both the primary and partner servers. Look for messages related to "Database Mirroring" or "Endpoint connection failed." If the partner server is rejecting the connection, the error log will usually specify if it is a login failure or a name mismatch.
If the logs indicate a naming discrepancy, check the sys.servers table. If the name listed there does not match the current network name of the server, you may need to update the internal server name. This is done by running sp_dropserver 'OldName' followed by sp_addserver 'NewName', 'local'. Note that this requires a restart of the SQL Server service to take effect.
Check the Windows Firewall on both servers. Even if the name is correct, if the port (5022) is blocked, the primary server may return a generic error or a partner instance error because it cannot reach the instance to verify its name. Create an inbound rule on the partner server to allow TCP traffic on the specific port used by the mirroring endpoint.
Verify the Service Account. Ensure both SQL Server instances are running under a domain account. If one is running as LocalSystem and the other as a domain user, the authentication handshake will fail. This failure can sometimes be misreported as a partner instance name error because the primary server cannot successfully "handshake" with the named instance on the other end.
Frequently Asked Questions
Does Error 1452 mean the server is offline?
Not necessarily. It specifically means the name provided does not match the expected partner instance name. The server could be online, but the identity provided in the configuration command is incorrect or unrecognized.
Can I use an IP address instead of a server name?
While you can use an IP address in the TCP string (e.g., TCP://192.168.1.10:5022), it is generally discouraged. Mirroring relies on the identity of the instance; using an IP address can lead to issues if the IP changes or if the server relies on name-based authentication.
Why does the mirroring wizard fail with this error?
The wizard fails when the name entered in the "Partner Server" field does not resolve to a valid SQL Server instance that is configured for mirroring. This usually happens due to a typo, a DNS resolution failure, or the partner server having a different internal @@SERVERNAME.
Is this error related to Availability Groups?
Yes, Error 1452 can appear during the setup of Always On Availability Groups if the replica names are incorrectly specified or if the listener name is being confused with the individual instance names during the join process.
Do I need to restart SQL Server after fixing the name?
If you only changed the SET PARTNER command, no restart is needed. However, if you had to use sp_addserver to fix the internal server name, a full restart of the SQL Server service is required for the change to be recognized.