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

Troubleshooting Guide: Error 3743 – Database Mirroring Must Be Removed Before Dropping Database

Why This Error Happens

This error occurs because SQL Server 2025 blocks the DROP DATABASE command when the target database is still configured as a principal or mirror in a database mirroring session. The mirroring metadata and endpoint relationship remain active in the system catalog, which prevents the storage engine from safely releasing the database’s files and transaction log. Until the mirroring partnership is explicitly terminated, SQL Server treats the database as part of a high-availability topology and refuses the drop to avoid orphaning the mirror partner or witness server.

Step-by-Step Resolution Guide

Step 1: Verify the Current Mirroring State

  • Open SQL Server Management Studio (SSMS) and connect to the principal server instance.
  • Run the following query to confirm mirroring status:
  SELECT name, mirroring_state_desc, mirroring_role_desc 
  FROM sys.database_mirroring 
  WHERE database_id = DB_ID('YourDatabaseName');
  • Confirm whether the database is acting as a PRINCIPAL or MIRROR, as this determines which server you must run the removal command on.

Step 2: Remove the Database Mirroring Partnership

  • On the principal server instance, execute the following T-SQL command to break the mirroring session:
  ALTER DATABASE [YourDatabaseName] SET PARTNER OFF;
  • If a witness server is configured, ensure it is reachable; otherwise, use ALTER DATABASE ... SET PARTNER OFF directly from the principal, as this command does not require the witness to respond.
  • Wait a few seconds and re-run the query from Step 1 to confirm mirroring_state_desc now returns NULL, indicating mirroring has been fully disabled.

Step 3: Clean Up Endpoints (If Applicable)

  • Navigate to Object Explorer > Server Objects > Endpoints in SSMS on both the former principal and mirror instances.
  • If the mirroring endpoint (typically named Mirroring on TCP port 5022) is no longer needed for other databases, remove it using:
  DROP ENDPOINT [Mirroring];
  • Skip this step if the endpoint is shared with other mirrored databases on the same instance.

Step 4: Drop the Database

  • With mirroring fully removed, execute the standard drop command:
  DROP DATABASE [YourDatabaseName];
  • If the command still fails, check for active connections using sp_who2 and set the database to single-user mode first:
  ALTER DATABASE [YourDatabaseName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  DROP DATABASE [YourDatabaseName];

Alternative or Verification Steps

  • Verify Success: Re-query sys.databases to confirm the database no longer appears in the list: SELECT name FROM sys.databases WHERE name = 'YourDatabaseName'; (should return zero rows).
  • Alternative Fix: If SET PARTNER OFF fails due to a broken network link to the mirror, force the removal using ALTER DATABASE [YourDatabaseName] SET PARTNER OFF; directly on the mirror server if it is still accessible, or restore the database from a backup on a clean instance and drop it there instead.