How to fix Error 9743 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 9743

Why This Error Happens

Error 9743 occurs when the ALTER DATABASE ... SET PARTNER or SET WITNESS statement is executed with a routing endpoint URL that specifies a database instance name, named instance port alias, or hostname alias instead of a literal, resolvable network address. Database Mirroring in SQL Server strictly requires the TCP:// endpoint address to use a system-recognized address format (hostname, FQDN, or IP address) rather than an “instance” style identifier. This typically happens when an administrator copies a connection string formatted for client applications (which supports named instances) directly into the mirroring configuration syntax, which does not support that same resolution logic.

Step-by-Step Resolution Guide

Step 1: Identify the Malformed Endpoint Syntax

  • Open SQL Server Management Studio (SSMS) and review the Transact-SQL script used to configure the mirroring session.
  • Locate the SET PARTNER or SET WITNESS clause in your script.
  • Check for syntax errors such as TCP://SQLServerInstanceName where an instance name is used instead of a machine address.

Step 2: Correct the TCP Address Format

  • Rewrite the endpoint address to strictly follow the format: TCP://<System Address>:<Port Number>.
  • Replace any instance aliases with the actual Fully Qualified Domain Name (FQDN) or static IP address of the server hosting the endpoint.
  • Example of a valid corrected syntax: ALTER DATABASE [YourDB] SET PARTNER = 'TCP://SQLServer01.domain.com:5022';
  • Ensure you are not including the SQL Server instance name (e.g., SERVER\INSTANCE) inside the TCP address string, as mirroring endpoints communicate via port numbers, not instance names.

Step 3: Verify Endpoint Configuration in SQL Server

  • Run the following query on both the Principal and Mirror servers to check the current endpoint port and status:
SELECT type_desc, port, state_desc FROM sys.tcp_endpoints;
  • Confirm the port number you are using in the TCP:// address matches the port listed in the sys.tcp_endpoints result set (default is often 5022, but verify your specific configuration).

Step 4: Re-execute the Mirroring Command

  • Open a new query window in SSMS connected to the Principal server.
  • Re-run the corrected ALTER DATABASE command with the properly formatted address.
  • Monitor the “Messages” tab in SSMS to confirm the command completes without throwing Error 9743 or subsequent connection timeouts.

Alternative or Verification Steps

  • Verification: Check the SQL Server Error Log or the Windows Event Viewer (Event ID related to Database Mirroring) immediately after running the command to ensure the state changes to “SYNCHRONIZED” or “SYNCHRONIZING” rather than throwing a connection refusal.
  • Alternative: If manual syntax continues to fail, use the Configure Database Mirroring Security Wizard within SSMS (right-click the database > Tasks > Mirror > Configure Security) to auto-generate the correct TCP addresses and avoid manual typos.