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

Troubleshooting Guide: SQL Server Error 7862

Why This Error Happens

Error 7862 occurs because SQL Server 2025 restricts certain endpoint types—such as TSQL Default, Service Broker, Database Mirroring, or SOAP—to only one instance per server instance. This typically happens when a DBA or an automated deployment script attempts to run a CREATE ENDPOINT statement without first checking sys.endpoints for an existing configuration of that type. It can also occur after a failed migration or restore where endpoint metadata persists even though the original configuration appears inactive.

Step-by-Step Resolution Guide

Step 1: Identify the Conflicting Endpoint

  • Open SQL Server Management Studio (SSMS) and connect to the instance reporting the error on Windows Server 2025.
  • Run the following query to list all current endpoints and their types:
  SELECT name, protocol_desc, type_desc, state_desc FROM sys.endpoints;
  • Locate the endpoint matching the type you are trying to create (e.g., TSQL, DATABASE_MIRRORING, or SERVICE_BROKER).

Step 2: Modify or Remove the Existing Endpoint

  • If the existing endpoint is still required but needs new settings, use ALTER ENDPOINT instead of CREATE ENDPOINT to update the port or authentication settings.
  • Example syntax:
  ALTER ENDPOINT [Endpoint_Mirroring] STATE = STARTED AS TCP (LISTENER_PORT = 5022);
  • If the endpoint is obsolete or was created by mistake, drop it using the exact name retrieved in Step 1:
  DROP ENDPOINT [Endpoint_Name];

Step 3: Re-run the Creation Script

  • Once the conflicting endpoint is dropped or altered, execute your original CREATE ENDPOINT script again.
  • Ensure the script specifies a unique port number (commonly 5022 for mirroring or 1433 for TSQL) to avoid triggering a secondary port-binding conflict in Windows Firewall.

Step 4: Restart the SQL Server Service (If Necessary)

  • Navigate to Services.msc on Windows Server 2025 or Windows 11.
  • Restart the SQL Server (MSSQLSERVER) service to clear any cached endpoint metadata that might be lingering in memory.

Alternative or Verification Steps

  • Verify the fix by re-querying sys.endpoints and sys.tcp_endpoints to confirm only one instance of the specific endpoint type exists and that its state_desc shows as STARTED.
  • If DROP ENDPOINT fails due to active connections, use sp_who2 to identify and kill the blocking session ID (SPID) before retrying the drop command.