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

Troubleshooting Guide: Error 1488 – Database in Single User Mode Incompatible with Mirroring/AG

Why This Error Happens

This error occurs because SQL Server 2025 requires databases participating in an Availability Group (AG) or database mirroring session to be accessible by multiple sessions simultaneously for synchronization processes to function correctly. When a database is set to SINGLE_USER mode, only one connection can access it at a time, which blocks the background worker threads that SQL Server uses to replicate transaction log records between replicas. This typically happens when an administrator restricts the database to single-user mode for maintenance (such as restoring a database or running DBCC CHECKDB with repair options) and forgets to revert the setting before attempting to join it to an AG or mirror session.

Step-by-Step Resolution Guide

Step 1: Verify the Current Database State

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and connect to the instance via a Dedicated Administrator Connection (DAC) if standard connections are being blocked.
  • Run the following query to check the current user access setting:
SELECT name, user_access_desc 
FROM sys.databases 
WHERE name = 'YourDatabaseName';
  • Confirm the user_access_desc column returns SINGLE_USER.

Step 2: Change the Database to Multi-User Mode

  • Execute the following T-SQL command to revert the access mode, ensuring no other critical processes are using the single-user connection:
ALTER DATABASE [YourDatabaseName] 
SET MULTI_USER;
  • If the command hangs, check for blocking sessions using sp_who2 and terminate the single active session using KILL [SPID] if it is safe to do so.
  • Ensure you are running this command with sysadmin fixed server role permissions, as insufficient privileges will cause the command to fail silently or throw a permission error.

Step 3: Re-attempt the Mirroring or Availability Group Configuration

  • Navigate back to SQL Server Management Studio.
  • Right-click Availability Groups (or Database Mirroring properties) and attempt to add the database or resume the session again.
  • If using PowerShell, re-run the Add-SqlAvailabilityDatabase cmdlet now that the database is accessible to multiple connections.

Step 4: Check Windows Server Specific Permissions

  • On Windows Server 2025, verify that the SQL Server Service Account has not been altered in the Services management console (services.msc), as a service restart during the single-user mode change can sometimes reset session states unexpectedly.
  • Confirm the Windows Firewall isn’t flagging the state change as a new connection attempt, which can sometimes compound with mirroring endpoint errors.

Alternative or Verification Steps

  • Verification: Re-run the SELECT name, user_access_desc FROM sys.databases query from Step 1; the status should now read MULTI_USER. Check the Always On High Availability dashboard in SSMS to confirm the specific database shows a “Synchronized” or “Synchronizing” status rather than an error icon.
  • Alternative: If the ALTER DATABASE command fails due to a stuck process, restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER to clear the single-user lock, then immediately re-run the Step 2 command before any other application reconnects.

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

Why This Error Happens

Error 1487 is not actually a failure condition; it is an informational log entry generated by SQL Server’s Database Mirroring engine during the REDO phase on the mirror server. It appears when the mirror database starts multiple parallel threads to apply transaction log records faster, which typically correlates with the number of logical CPU cores available to the SQL Server instance. This message is logged simply to confirm that parallel redo (introduced to improve mirroring/Always On failover recovery speed) is active and functioning as designed—no corruption, permission issue, or port conflict is involved.

Step-by-Step Resolution Guide

Step 1: Confirm the Message is Informational, Not an Error

  • Open the SQL Server Error Log via SSMS (Management > SQL Server Logs) or check C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Verify the entry explicitly states “This is an informational message only. No user action is required.”
  • Confirm there are no accompanying error-severity messages (Severity 16+) near the same timestamp.

Step 2: Validate Mirroring/Always On Health

  • Run the following query on the mirror instance to confirm synchronization state:
  SELECT database_name, mirroring_state_desc, mirroring_role_desc 
  FROM sys.database_mirroring 
  WHERE mirroring_guid IS NOT NULL;
  • Ensure mirroring_state_desc returns SYNCHRONIZED or SYNCHRONIZING, not SUSPENDED.
  • Check Windows Event Viewer (Applications and Services Logs > MSSQLSERVER) for any correlating Severity 16+ errors if performance seems degraded.

Step 3: Review Parallel Redo Thread Allocation (If Tuning Is Desired)

  • Open SQL Server Configuration Manager and check the number of logical processors assigned under SQL Server Services > Properties > Advanced.
  • If you want to limit the number of redo threads (e.g., to control CPU contention on Windows Server 2025 with high core counts), use trace flag 9571 at startup to disable parallel redo, or 9572 to force it on:
  -T9571
  • Add this flag via SQL Server Configuration Manager > Startup Parameters, then restart the MSSQLSERVER service.

Step 4: Monitor Resource Usage During Redo

  • Use Performance Monitor (PerfMon) on Windows Server 2025 to track the SQLServer:Database Replica counter, specifically Redo Bytes Remaining and Redo Rate.
  • Confirm CPU and I/O are not being bottlenecked by excessive parallel threads if you have more than 16+ cores allocated.

Alternative or Verification Steps

  • Verify mirroring status post-step changes using: SELECT * FROM sys.dm_db_mirroring_connections; — confirm no connection drops or redo stalls.
  • If redo appears abnormally slow despite multiple threads, consider manually capping the degree of parallelism via trace flag 9571 and re-test failover timing in a staging environment before production rollout.

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

Troubleshooting Guide: SQL Server Error 1486 – Database Mirroring Transport Disabled

Why This Error Happens

Error 1486 occurs when the Database Mirroring endpoint has been explicitly set to a DISABLED state in SQL Server, which prevents the instance from accepting or initiating mirroring/Availability Group connections over the network. This typically happens after a server restart, a configuration script that incorrectly sets the endpoint state, or an administrator manually disabling the endpoint for maintenance without re-enabling it. It can also surface if the endpoint was never properly started after creation, leaving the transport layer inactive while the logical endpoint object still exists in metadata.

Step-by-Step Resolution Guide

Step 1: Verify the Current Endpoint State

  • Connect to the affected SQL Server 2025 instance using SQL Server Management Studio (SSMS) or sqlcmd.
  • Run the following query to check the endpoint status:
  SELECT name, type_desc, state_desc 
  FROM sys.database_mirroring_endpoints;
  • Confirm that state_desc returns DISABLED rather than STARTED.

Step 2: Re-Enable the Mirroring Endpoint

  • Execute an ALTER ENDPOINT statement to force the state to STARTED:
  ALTER ENDPOINT [Mirroring]
  STATE = STARTED
  AS TCP (LISTENER_PORT = 5022)
  FOR DATABASE_MIRRORING (ROLE = ALL);
  • Replace [Mirroring] with the actual endpoint name if it differs, and confirm port 5022 matches your environment’s configured listener port.

Step 3: Check Windows Firewall and Service Account Permissions

  • Open Windows Defender Firewall with Advanced Security on Windows Server 2025 and ensure an inbound rule exists allowing TCP traffic on port 5022.
  • Verify the SQL Server service account has CONNECT permission on the endpoint:
  GRANT CONNECT ON ENDPOINT::[Mirroring] TO [DOMAIN\SQLServiceAccount];
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER / net start MSSQLSERVER if changes do not take effect immediately.

Step 4: Validate Availability Group or Mirroring Session Health

  • Re-run the mirroring setup wizard or ALTER AVAILABILITY GROUP command to re-establish the session if it was previously broken by the disabled endpoint.
  • Check SQL Server Error Logs (Management > SQL Server Logs in SSMS) for confirmation messages indicating the endpoint is now listening.

Alternative or Verification Steps

  • Run SELECT * FROM sys.tcp_endpoints; to confirm the endpoint is actively listening on the correct port and IP address.
  • If the issue persists, drop and recreate the endpoint entirely using CREATE ENDPOINT, then reconfigure the mirroring/Availability Group partners to avoid residual corrupted metadata.

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

Troubleshooting Guide: SQL Server Error 1485 (Database Mirroring Deprecated Feature Notice)

Why This Error Happens

Error 1485 occurs because Database Mirroring is a deprecated feature in modern SQL Server releases, and SQL Server 2025 raises this warning whenever mirroring is enabled on an instance to alert administrators that the feature is scheduled for removal. This typically happens when a database is restored from an older backup with mirroring metadata intact, or when legacy scripts/configurations attempt to invoke ALTER DATABASE ... SET PARTNER or sp_configure settings tied to mirroring endpoints. The error is not a functional failure but a compliance/compatibility notice indicating your architecture relies on an unsupported high-availability mechanism.

Step-by-Step Resolution Guide

Step 1: Identify Mirroring Dependencies

  • Open SQL Server Management Studio (SSMS) and run SELECT * FROM sys.database_mirroring WHERE mirroring_state IS NOT NULL; to list all databases with active mirroring sessions.
  • Check SQL Server Error Log (via EXEC sp_readerrorlog) for the exact timestamp and database name associated with Error 1485.
  • Review any legacy PowerShell or T-SQL deployment scripts for ALTER DATABASE SET PARTNER or ALTER DATABASE SET WITNESS commands.

Step 2: Migrate to Always On Availability Groups

  • Since mirroring is deprecated, plan a migration to Always On Availability Groups (AG), which is the supported replacement in SQL Server 2025.
  • Enable the Always On Availability Groups feature via SQL Server Configuration Manager: navigate to SQL Server Services > [Your Instance] > Properties > Always On Availability Groups tab, and check “Enable Always On Availability Groups.”
  • Restart the SQL Server service for the change to take effect (net stop MSSQLSERVER followed by net start MSSQLSERVER, or via Services.msc on Windows Server 2025).
  • Use the “New Availability Group Wizard” in SSMS to recreate your HA topology using the previously mirrored databases as primary replicas.

Step 3: Remove Legacy Mirroring Configuration

  • Once failover protection is re-established via AG, break the existing mirroring session by running ALTER DATABASE [YourDB] SET PARTNER OFF; on the principal server.
  • Drop any orphaned mirroring endpoints using DROP ENDPOINT [Mirroring_Endpoint_Name]; to prevent the instance from re-triggering Error 1485 on restart.
  • Verify no mirroring-related extended events sessions are still running by checking sys.server_event_sessions.

Step 4: Suppress or Acknowledge the Warning (Temporary Workaround)

  • If immediate migration to Always On AG isn’t feasible, acknowledge the deprecation notice is logged for compliance tracking only and does not block mirroring functionality in this release.
  • Document the planned migration timeline in your change management system, since mirroring support may be fully removed in a future cumulative update.

Alternative or Verification Steps

  • Verify the fix by querying sys.database_mirroring again post-migration — it should return no active mirroring states, and sys.dm_hadr_availability_group_states should show your new AG as “Healthy.”
  • As an alternative, if Always On AG is not licensed in your SQL Server edition, consider Log Shipping as a lower-complexity, officially supported fallback for disaster recovery instead of mirroring.

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

Why This Error Happens

Database Mirroring and Accelerated Database Recovery (ADR) are mutually exclusive features in SQL Server because they both rely on conflicting mechanisms to manage the transaction log and database recovery process. ADR uses a Persistent Version Store (PVS) to enable instantaneous rollback, while Mirroring requires a specific log-shipping sequence that is incompatible with PVS-based recovery. When SQL Server detects that ADR is active on a database, it blocks the ALTER DATABASE SET PARTNER or mirroring setup command to prevent transaction log corruption or synchronization failures between the principal and mirror servers.

Step-by-Step Resolution Guide

Step 1: Verify the Current ADR Status

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and connect to the target instance.
  • Run the following query to check if ADR is enabled on the database in question:
  • SELECT name, is_accelerated_database_recovery_on FROM sys.databases WHERE name = 'YourDatabaseName';
  • If the result returns 1, ADR is active and is the direct cause of Error 1484.

Step 2: Disable Accelerated Database Recovery

  • Since ADR cannot coexist with Mirroring, you must turn it off before configuring the mirroring session.
  • Execute the following T-SQL command in a new query window:
  • ALTER DATABASE [YourDatabaseName] SET ACCELERATED_DATABASE_RECOVERY = OFF;
  • Note: This command requires exclusive access or minimal active transactions; ensure no long-running transactions are blocking the schema change.

Step 3: Clear the Persistent Version Store (PVS)

  • Disabling ADR does not immediately clean up the version store; residual PVS data can sometimes cause lingering configuration locks.
  • Run DBCC SHRINKDATABASE with the PVS_CLEANUP option if you are on a Cumulative Update that supports manual cleanup, or restart the SQL Server service to force a cleanup cycle via the Windows Services management console (services.msc).
  • Verify the PVS is cleared by checking sys.dm_tran_persistent_version_store_stats for the specific database_id.

Step 4: Re-initiate the Database Mirroring Setup

  • Once ADR is confirmed as OFF, proceed with the mirroring configuration wizard in SSMS, or run the manual script.
  • Use the following syntax on the Principal server to re-link the partner:
  • ALTER DATABASE [YourDatabaseName] SET PARTNER = 'TCP://MirrorServerName.domain.com:5022';
  • Ensure the endpoint ports (default 5022) are open in the Windows Defender Firewall with Advanced Security on both the Principal and Mirror servers running Windows Server 2025.

Alternative or Verification Steps

  • Verification: Re-run the sys.databases query from Step 1; the is_accelerated_database_recovery_on column should now show 0, and the mirroring state in sys.database_mirroring should transition to SYNCHRONIZED.
  • Alternative: If your environment specifically requires ADR for rollback performance, consider migrating to an Always On Availability Group instead of legacy Database Mirroring, as Availability Groups in SQL Server 2025 fully support ADR-enabled databases.

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

Troubleshooting Guide: SQL Server Error 1483 – Database State Information (Hardened LSN / Commit LSN Mismatch)

Why This Error Happens

Error 1483 is an informational/diagnostic message that SQL Server logs when it reports the synchronization state of a database, specifically detailing the Hardened LSN (Log Sequence Number), Commit LSN, and Commit Time. This typically surfaces during Availability Group synchronization, database mirroring, or recovery operations when SQL Server is logging the exact point of log hardening to help diagnose data loss exposure or lag between the primary and secondary replicas. The underlying cause is usually a mismatch between how much log data has been hardened to disk (durably written) versus what has been committed, often due to I/O subsystem latency, network lag between AG replicas, or an abrupt failover/restart event.

Step-by-Step Resolution Guide

Step 1: Identify the Context of the Error in SQL Server Logs

  • Open SQL Server Error Log via SSMS (Management > SQL Server Logs) or check C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG on Windows Server 2025.
  • Note whether this appears during a failover, restart, or routine AG health check — this determines if it’s benign (informational) or indicative of a stall.
  • Cross-reference the timestamp with Windows Event Viewer (Application Log) for correlating disk or network warnings.

Step 2: Check Availability Group / Mirroring Health

  • Run the following query to inspect synchronization health:
SELECT ag.name, ar.replica_server_name, drs.synchronization_state_desc, 
drs.log_send_queue_size, drs.redo_queue_size
FROM sys.dm_hadr_database_replica_states drs
JOIN sys.availability_replicas ar ON drs.replica_id = ar.replica_id
JOIN sys.availability_groups ag ON ar.group_id = ag.group_id;
  • Look for high log_send_queue_size or redo_queue_size, which indicates the secondary cannot harden logs fast enough.
  • If the environment uses Synchronous Commit mode, verify network latency between replicas isn’t exceeding acceptable thresholds (ideally under 5ms round-trip).

Step 3: Validate Disk I/O and Storage Subsystem

  • Use Perfmon on Windows Server 2025 to monitor Avg. Disk sec/Write on the volume hosting the transaction log (.ldf) files.
  • Values consistently above 15-20ms indicate the storage is too slow to harden log records in time, directly causing the LSN gap reported in Error 1483.
  • If using virtualized storage (Hyper-V/Azure), confirm the virtual disk isn’t throttled and is using write-caching policies appropriate for SQL transaction logs.

Step 4: Review and Adjust the Endpoint/Mirroring Timeout Settings

  • If this error coincides with connection drops, check the mirroring endpoint timeout:
ALTER ENDPOINT [Hadr_endpoint] 
FOR DATABASE_MIRRORING (TIMEOUT = 30);
  • Ensure firewall rules on Windows Server 2025 aren’t dropping long-lived TCP connections on the Database Mirroring Endpoint port (commonly 5022).

Step 5: Apply Latest Cumulative Update

  • Navigate to Microsoft’s official download center and install the latest Cumulative Update (CU) for SQL Server 2025.
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER after patching to ensure the fix for LSN logging/reporting accuracy is applied.

Alternative or Verification Steps

  • Verify the Fix: Re-run the sys.dm_hadr_database_replica_states query from Step 2; confirm log_send_queue_size and redo_queue_size trend toward zero and remain stable under load.
  • Alternative Solution: If the Hardened LSN gap persists despite healthy network/disk metrics, temporarily switch the Availability Group to Asynchronous-Commit mode to isolate whether the issue is purely synchronous-commit latency versus an underlying storage corruption issue, then run DBCC CHECKDB on the affected database to rule out physical corruption.

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

Troubleshooting Guide: Error 1482 — Database Mirroring Failed to Get Snapshot Synchronization Lock

Why This Error Happens

Error 1482 typically occurs when SQL Server cannot obtain the exclusive lock required to synchronize a database snapshot during the mirroring session setup, usually because another process (such as a backup job, DBCC command, or lingering transaction) is holding a conflicting lock on the principal or mirror database. This can also happen if the mirroring endpoint connection is unstable, causing the synchronization handshake to time out before the lock is granted. In some cases, corrupted or overly fragmented transaction log files on Windows Server 2025 prevent the snapshot operation from completing within the lock timeout window.

Step-by-Step Resolution Guide

Step 1: Identify Blocking Processes on the Database

  • Run sp_who2 or query sys.dm_exec_requests to check for sessions holding locks on the mirrored database.
  • Look specifically for LCK_M_X wait types tied to the database in question.
  • If found, terminate the blocking session using KILL <session_id> (only after confirming it is safe to do so).

Step 2: Verify Mirroring Endpoint and Network Stability

  • Open SQL Server Configuration Manager and confirm the mirroring endpoint is listed under SQL Server Network Configuration > Protocols.
  • Check that the TCP port (default 5022) is not blocked by Windows Defender Firewall:
  netsh advfirewall firewall show rule name="SQL Mirroring Endpoint"
  • If missing, add a new inbound rule allowing TCP port 5022 for the SQL Server service account.

Step 3: Pause and Resume the Mirroring Session

  • In SQL Server Management Studio (SSMS), right-click the mirrored database and select Tasks > Mirror > Pause.
  • Wait 30–60 seconds to allow any pending locks to release, then select Resume.
  • Alternatively, run the T-SQL command:
  ALTER DATABASE [YourDB] SET PARTNER RESUME;

Step 4: Rebuild the Database Snapshot

  • Drop any stale or orphaned snapshot files located in the default data directory (e.g., C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).
  • Manually recreate the snapshot using:
  CREATE DATABASE YourDB_Snapshot ON
  (NAME = YourDB_Data, FILENAME = 'C:\SQLSnapshots\YourDB_Snapshot.ss')
  AS SNAPSHOT OF YourDB;
  • Restart the mirroring session once the snapshot is successfully created.

Step 5: Check Transaction Log Health

  • Run DBCC CHECKDB on both the principal and mirror databases to rule out log corruption.
  • If fragmentation is high, shrink and regrow the log file using DBCC SHRINKFILE followed by a manual log backup.

Alternative or Verification Steps

  • Confirm the fix by checking the SQL Server Error Log and Windows Event Viewer (Application log) for the absence of Event ID 1482 after resuming mirroring.
  • If the issue persists, consider switching to Always On Availability Groups instead of legacy database mirroring, as it offers improved synchronization handling on Windows Server 2025.

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

Why This Error Happens

Error 1481 occurs when SQL Server’s automatic page repair feature in a database mirroring session detects a corrupted page but cannot retrieve a clean copy from the mirroring partner. This typically happens due to broken network connectivity between the principal and mirror instances, the mirroring endpoint being unreachable or disabled, or because the corresponding page on the partner server is also corrupted or otherwise unavailable. Firewall restrictions on Windows Server 2025/Windows 11 blocking the mirroring TCP port are also a common underlying cause.

Step-by-Step Resolution Guide

Step 1: Verify Network Connectivity Between Partners

  • Use Test-NetConnection -ComputerName <PartnerServerName> -Port <MirroringEndpointPort> in PowerShell to confirm the mirroring port (commonly 5022) is reachable.
  • Check Windows Defender Firewall on both the principal and mirror servers (Control Panel > Windows Defender Firewall > Advanced Settings) to ensure an inbound rule exists for the SQL Server mirroring endpoint port.
  • Confirm no intermediate network switches, VLAN segmentation, or VPN tunnels are dropping packets between nodes.

Step 2: Validate the Mirroring Endpoint Status

  • Run the following T-SQL on both instances to confirm the endpoint is started:
  SELECT name, state_desc FROM sys.database_mirroring_endpoints;
  • If the state shows STOPPED, start it using:
  ALTER ENDPOINT [Mirroring] STATE = STARTED;
  • Check SQL Server Configuration Manager to ensure the SQL Server service account has proper permissions on the endpoint certificate (if using certificate-based authentication).

Step 3: Check for Page-Level Corruption on Both Sides

  • Run DBCC CHECKDB (<DatabaseName>) WITH NO_INFOMSGS, ALL_ERRORMSGS; on both the principal and mirror databases to identify if the corruption exists on both copies.
  • Query sys.dm_db_mirroring_auto_page_repair to see the history and status of automatic page repair attempts:
  SELECT * FROM sys.dm_db_mirroring_auto_page_repair
  WHERE database_id = DB_ID('<DatabaseName>');
  • If corruption exists only on the principal, restart the mirroring session to trigger a retry of the automatic page repair.

Step 4: Restore From Backup if Repair Fails

  • If both copies are corrupted or the partner cannot supply a clean page, restore the affected database (or just the damaged page, using RESTORE DATABASE ... PAGE = 'FileID:PageID') from the most recent full backup plus transaction log backups.
  • Ensure backups are stored on a separate, verified-healthy disk subsystem to avoid repeating the same corruption.

Step 5: Review Disk and Hardware Health

  • Run chkdsk <DriveLetter>: /f /r on the volumes hosting the SQL Server data files to rule out underlying disk corruption.
  • Review Windows Event Viewer (System and Application logs) for recurring disk, controller, or storage-related warnings that could be causing ongoing page corruption.

Alternative or Verification Steps

  • After applying fixes, re-run DBCC CHECKDB on both the principal and mirror databases to confirm there are no further corruption reports, and monitor sys.dm_db_mirroring_auto_page_repair for a SUCCESS status instead of WRITE_ERROR or IRREPARABLE_ERROR.
  • If mirroring continues to fail, consider migrating to an Always On Availability Group, which offers more robust automatic page repair and failover diagnostics in SQL Server 2025.

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

Troubleshooting Guide: SQL Server Error 1480 – Database Role Change Due to Failover

Why This Error Happens

Error 1480 is an informational message, not a critical failure, and is logged whenever a database participating in a Database Mirroring session or an Availability Group (AG) transitions roles (e.g., from Primary to Secondary) due to an automatic or manual failover. This typically occurs because of a loss of connectivity between replicas, a manual failover triggered by an administrator, a Windows Server Failover Clustering (WSFC) quorum event, or the primary replica becoming unresponsive due to resource exhaustion (CPU, memory, or I/O). While the message itself requires no action, frequent, unexpected occurrences often point to underlying network instability or health detection thresholds being too sensitive.

Step-by-Step Resolution Guide

Step 1: Confirm the Failover Was Expected

  • Open the SQL Server Error Log or Always On Dashboard in SSMS to check the timestamp of the role change.
  • Cross-reference the time with any planned maintenance, patching via Windows Update, or manual failover commands (ALTER AVAILABILITY GROUP ... FAILOVER).
  • If the failover was intentional (e.g., patching Windows Server 2025 nodes), no further action is needed.

Step 2: Investigate Network Latency and Cluster Health

  • Check the Windows Server Failover Cluster (WSFC) logs located via Get-ClusterLog -Destination C:\ClusterLogs in PowerShell to look for missed heartbeats between nodes.
  • Verify the network connection between the Primary and Secondary replicas is stable by running Test-Connection or ping -t to the partner server during peak load times.
  • Review the Lease Timeout and Session Timeout settings in the Availability Group properties; a default of 10 seconds might be too aggressive for high-latency WAN environments.

Step 3: Review Resource Utilization on the Former Primary

  • Open Performance Monitor (PerfMon) on the server that lost primary status and check counters for Processor Time, Available MBytes, and Avg. Disk sec/Transfer around the time of the event.
  • If the server was unresponsive due to high memory pressure, adjust the max server memory setting in SQL Server Configuration Manager to leave sufficient headroom for the OS.
  • Check Windows Event Viewer under System logs for any corresponding hardware or driver-level errors (Event ID 153 or 157) that might explain the unresponsiveness.

Step 4: Adjust Flexible Failover Policy (If Applicable)

  • Navigate to the Availability Group properties in SSMS and select the Backup Preferences or Failure Conditions tab.
  • If failovers are happening too easily due to transient issues, consider changing the Flexible Failover Policy from a lower level (e.g., “On any qualified failure condition”) to “On server down” (Level 1) to reduce sensitivity.
  • Apply the changes and restart the SQL Server Agent service to ensure the new policy takes effect immediately.

Alternative or Verification Steps

  • Verify the Fix: Query the DMV sys.dm_hadr_database_replica_states on the current primary replica to confirm is_local and role_desc columns show the expected “PRIMARY” status with a synchronization_health of “HEALTHY.”
  • Alternative Check: If failovers continue intermittently, use sp_server_diagnostics to capture internal component health states, which can reveal if the SQL Server resource DLL is flagging false positives to the Cluster service.

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

Troubleshooting Guide: Error 1479 – Database Mirroring Connection Timeout

Why This Error Happens

Error 1479 occurs when the principal and mirror server instances cannot complete the required acknowledgment handshake within the configured timeout window, typically due to network latency or firewall interference on the mirroring endpoint port. This is frequently caused by the Windows Firewall blocking the TCP endpoint (default port 5022), a stopped or unresponsive SQL Server service on the partner node, or DNS/name resolution failures preventing the servers from reaching each other. Additionally, mismatched certificates or expired security contexts in the database mirroring endpoint can cause the connection to silently drop before timing out.

Step-by-Step Resolution Guide

Step 1: Verify the Mirroring Endpoint Status and Port Configuration

  • Run SELECT * FROM sys.database_mirroring_endpoints; on both the principal and mirror instances to confirm the endpoint is in a STARTED state.
  • Check that the endpoint is listening on the expected port (default 5022) using netstat -ano | findstr 5022 in an elevated PowerShell/Command Prompt on Windows Server 2025.
  • If the endpoint state shows STOPPED, restart it manually with ALTER ENDPOINT [Mirroring] STATE = STARTED;.

Step 2: Adjust Windows Firewall and Network Rules

  • Open Windows Defender Firewall with Advanced Security and create an inbound rule allowing TCP traffic on port 5022 for the sqlservr.exe process.
  • Ensure the rule applies to both Domain and Private network profiles if the servers are in a Windows Server 2025 failover cluster environment.
  • Use Test-NetConnection -ComputerName <PartnerServerName> -Port 5022 in PowerShell to confirm connectivity between the principal and mirror nodes.

Step 3: Increase the Mirroring Timeout Value

  • Execute ALTER DATABASE [YourDatabaseName] SET PARTNER TIMEOUT 30; on the principal server to extend the default 10-second timeout, allowing more buffer for slow network responses.
  • Avoid setting this value excessively high (above 60 seconds), as it can delay failover detection in high-availability scenarios.

Step 4: Validate Service Account Permissions and Certificates

  • Confirm that the SQL Server service account has not changed and still has CONNECT permission on the mirroring endpoint: GRANT CONNECT ON ENDPOINT::[Mirroring] TO [DOMAIN\ServiceAccount];.
  • If using certificate-based authentication, verify the certificates have not expired by querying sys.certificates and reissue them if the expiry_date has passed.

Step 5: Restart the SQL Server and Mirroring Services

  • Restart the SQL Server service on both the principal and mirror instances via services.msc or Restart-Service -Name 'MSSQLSERVER' in PowerShell.
  • Re-establish the mirroring session using ALTER DATABASE [YourDatabaseName] SET PARTNER RESUME; once both services are confirmed online.

Alternative or Verification Steps

  • Check the SQL Server Error Log and Windows Event Viewer (Application log) for Event ID 1479 recurrence; if it no longer appears after 15-20 minutes of monitoring, the fix is confirmed.
  • As an alternative, if mirroring continues to fail intermittently, consider migrating to an Always On Availability Group configuration, which offers more robust timeout handling and automatic failover detection in SQL Server 2025.

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

Troubleshooting Guide: SQL Server Error 1478 — “The mirror database… is not caught up with the principal database”

Why This Error Happens

Error 1478 occurs when database mirroring (or an Always On session using mirroring-style synchronization) cannot keep the mirror database synchronized with the principal, typically because the network link between the principal and mirror instances is too slow, unstable, or saturated to transmit the transaction log fast enough. This can also be triggered by high transaction log generation rates on the principal that outpace the mirror’s I/O or CPU capacity, or by firewall/port blocking (default mirroring endpoint port 5022) causing intermittent packet loss. In some cases, a corrupted or paused mirroring endpoint certificate/authentication configuration on Windows Server 2025 can also cause repeated synchronization failures that surface as this error.

Step-by-Step Resolution Guide

Step 1: Verify Network Connectivity and Endpoint Status

  • Open a PowerShell or Command Prompt session on both the principal and mirror servers and run Test-NetConnection -ComputerName <MirrorServerName> -Port 5022 to confirm the mirroring endpoint port is reachable.
  • Check Windows Defender Firewall (Windows Server 2025 / Windows 11) under Windows Defender Firewall with Advanced Security > Inbound Rules to ensure TCP port 5022 is allowed for both SQL Server instances.
  • Run SELECT * FROM sys.database_mirroring_endpoints; in SQL Server Management Studio (SSMS) on both servers to confirm the endpoint state is STARTED, not STOPPED or DISABLED.

Step 2: Check Mirroring Session Health and Log Send Queue

  • On the principal database, run SELECT mirroring_state_desc, mirroring_role_desc, mirroring_safety_level_desc FROM sys.database_mirroring WHERE database_id = DB_ID('YourDatabaseName'); to check the current mirroring state.
  • Query sys.dm_db_log_stats or check the Log Send Queue / Redo Queue size via SSMS’s Database Mirroring Monitor (right-click database > Tasks > Launch Database Mirroring Monitor) to see if the mirror is falling significantly behind.
  • If the queue is large, pause non-essential transactional workloads on the principal temporarily to allow the mirror to catch up.

Step 3: Review SQL Server Error Logs and Resource Usage

  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG on both servers (adjust instance folder name as needed for your SQL Server 2025 installation) and search for repeated mirroring timeout or communication errors.
  • Open Performance Monitor (perfmon.exe) and add the counters SQLServer:Database Mirroring > Log Bytes Sent/sec and Log Send Queue KB to identify sustained bottlenecks.
  • Check CPU, disk I/O, and memory utilization on the mirror server via Task Manager or Resource Monitor to rule out hardware-level bottlenecks.

Step 4: Resynchronize or Restart the Mirroring Session

  • If the mirror is critically behind, run ALTER DATABASE YourDatabaseName SET PARTNER SUSPEND; on the principal, followed by ALTER DATABASE YourDatabaseName SET PARTNER RESUME; to force a resync attempt.
  • If corruption or endpoint misconfiguration is suspected, drop and recreate the mirroring endpoint using CREATE ENDPOINT with correct certificate authentication, then re-establish the mirroring partnership via ALTER DATABASE ... SET PARTNER = 'TCP://MirrorServer:5022';.

Alternative or Verification Steps

  • After applying fixes, re-run the Database Mirroring Monitor and confirm the mirroringstatedesc returns SYNCHRONIZED and the Log Send/Redo Queue sizes trend toward zero.
  • If mirroring continues to fail intermittently, consider migrating to an Always On Availability Group (recommended in SQL Server 2025, since Database Mirroring is deprecated) for more robust synchronization and automatic failover handling.

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

Troubleshooting Guide: Error 1477 – Database Mirroring Safety Level Must Be FULL

Why This Error Happens

This error occurs because the database mirroring session is currently running in High Performance mode (safety level OFF), which uses asynchronous transaction transfer between the principal and mirror servers. Manual failover is only supported when the mirroring safety level is set to FULL, since this guarantees synchronous data transfer and zero data loss between partners. SQL Server blocks the failover command to prevent potential data loss that could occur if an asynchronous mirror is promoted to principal.

Step-by-Step Resolution Guide

Step 1: Verify the Current Mirroring Operating Mode

  • Open SQL Server Management Studio (SSMS) and connect to the principal server instance.
  • Run the following query to check the current safety level:
  SELECT mirroring_safety_level_desc, mirroring_state_desc 
  FROM sys.database_mirroring 
  WHERE database_id = DB_ID('YourDatabaseName');
  • Confirm whether the result shows OFF (High Performance/Asynchronous) instead of FULL (High Safety/Synchronous).

Step 2: Change the Safety Level to FULL

  • On the principal server instance, execute the following T-SQL command to switch the mirroring mode to synchronous:
  ALTER DATABASE YourDatabaseName SET SAFETY FULL;
  • If using a witness server for automatic failover, ensure it is online and connected, as this affects quorum status.
  • Confirm no errors are returned and the command completes successfully.

Step 3: Confirm Synchronization State Before Failover

  • Wait for the mirror database to fully synchronize with the principal; this is required for a manual failover to succeed.
  • Check the synchronization status using:
  SELECT mirroring_state_desc 
  FROM sys.database_mirroring 
  WHERE database_id = DB_ID('YourDatabaseName');
  • Ensure the state reads SYNCHRONIZED (not SYNCHRONIZING) before proceeding.

Step 4: Execute the Manual Failover

  • Once the safety level is FULL and the state is SYNCHRONIZED, run the failover command on the principal server:
  ALTER DATABASE YourDatabaseName SET PARTNER FAILOVER;
  • Monitor the SQL Server Error Log or Event Viewer (Windows Logs > Application) on both nodes to confirm the roles have switched successfully.

Alternative or Verification Steps

  • Verification: After failover, re-run the sys.database_mirroring query on the new principal server; the mirroring_role_desc column should now display PRINCIPAL for the former mirror instance.
  • Alternative: If synchronization is stuck and never reaches “SYNCHRONIZED,” check network latency between the principal and mirror servers, as high latency can prevent the safety level from stabilizing in FULL mode, effectively blocking the failover prerequisite.

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

Troubleshooting Guide: SQL Server Error 1475 — Bulk Logged Changes Not Backed Up

Why This Error Happens

This error occurs because the database is operating under the Bulk-Logged recovery model, and minimally-logged operations (such as BULK INSERT, SELECT INTO, or index rebuilds) have been performed on the principal/primary database without a subsequent log backup. SQL Server blocks the mirroring or Always On synchronization process because it cannot guarantee the data pages affected by these bulk operations can be safely transmitted and applied to the mirror/secondary replica. Essentially, the transaction log contains data that exists only as pointers to the data file, not fully-logged transactional records, making it unsafe to continue the synchronization chain until a backup captures those actual data pages.

Step-by-Step Resolution Guide

Step 1: Identify the Current Recovery Model

  • Open SQL Server Management Studio (SSMS) and connect to the Principal/Primary instance.
  • Run the following query to check the current state:
  SELECT name, recovery_model_desc FROM sys.databases WHERE name = 'YourDatabaseName';
  • Confirm if the model is set to BULK_LOGGED.

Step 2: Take an Immediate Transaction Log Backup

  • Navigate to the backup directory (e.g., D:\SQLBackups\LogBackups\) to ensure sufficient disk space is available.
  • Execute a manual log backup to flush the bulk-logged extents into a physical backup file:
  BACKUP LOG [YourDatabaseName] 
  TO DISK = N'D:\SQLBackups\LogBackups\YourDatabaseName_LogFix.trn' 
  WITH NOFORMAT, NOINIT;
  • Wait for the command to complete successfully (Msg: “Processed X pages for database…”).

Step 3: Restore the Backup on the Secondary/Mirror

  • Copy the .trn file generated in Step 2 to the Secondary or Mirror server.
  • Restore the log file using the WITH NORECOVERY option to maintain the restore chain:
  RESTORE LOG [YourDatabaseName] 
  FROM DISK = N'D:\SQLBackups\LogBackups\YourDatabaseName_LogFix.trn' 
  WITH NORECOVERY;
  • Verify that the Mirroring/Availability Group dashboard in SSMS shows “Synchronized” or “Synchronizing” status.

Step 4: Switch Recovery Model to Prevent Recurrence

  • To avoid this issue in high-availability environments going forward, change the recovery model back to FULL.
  • Run this command on the Principal database:
  ALTER DATABASE [YourDatabaseName] SET RECOVERY FULL;
  • Note: BULK_LOGGED should only be used temporarily during massive ETL jobs and switched back to FULL immediately afterward.

Alternative or Verification Steps

  • Verification: Check the Always On Availability Groups dashboard or the Database Mirroring Monitor in SSMS to confirm the “Synchronization Health” status reads green/healthy and the error log no longer logs Event ID 1475.
  • Alternative: If a manual log backup is not feasible due to disk space constraints, configure a temporary backup job to a network share (UNC path) to capture the log, then immediately delete the file post-restoration to clear local disk space.

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

Troubleshooting Guide: Error 1476 – Database Mirroring Timeout Value Exceeds Maximum

Why This Error Happens

This error occurs when the ALTER DATABASE SET PARTNER TIMEOUT value specified during database mirroring configuration exceeds the maximum allowable threshold of 32767 seconds. SQL Server 2025 enforces this upper boundary because the timeout value is stored internally as a signed 16-bit integer, and any value beyond this range causes an overflow during validation. This typically results from a manual scripting error, a misconfigured automation/deployment template, or a copy-paste mistake from a legacy T-SQL script that used an incompatible or arbitrary large value.

Step-by-Step Resolution Guide

Step 1: Identify the Offending T-SQL Statement

  • Review the script or job that triggered the error, typically an ALTER DATABASE [YourDB] SET PARTNER TIMEOUT command.
  • Check SQL Server Agent job history or deployment pipeline logs (e.g., Azure DevOps, Jenkins) for the exact value passed.
  • Confirm the value in question by searching for TIMEOUT followed by a numeric parameter in the script.

Step 2: Correct the Timeout Value

  • Edit the script to use a valid timeout value between 1 and 32767 seconds (the default is 10 seconds).
  • Example corrected syntax:
  ALTER DATABASE [YourDatabaseName] SET PARTNER TIMEOUT 30;
  • Avoid using large placeholder values (e.g., 99999 or 2147483647) that were likely inherited from unrelated timeout configurations (such as connection or command timeouts).

Step 3: Validate Mirroring Configuration via SSMS

  • Open SQL Server Management Studio (SSMS) and connect to the principal server instance.
  • Navigate to Database Properties > Mirroring page to confirm the timeout field reflects a valid number.
  • Re-run the corrected script against the principal database only (timeout settings are not configured on the mirror).

Step 4: Re-deploy Through Automation Tools (If Applicable)

  • If the error originated from an Infrastructure-as-Code template (DSC, Terraform, or PowerShell DSC resource for SQL mirroring), update the hardcoded or variable-driven timeout parameter in the configuration file.
  • Re-run the deployment pipeline and monitor the SQL Server error log (%ProgramFiles%\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for confirmation that mirroring initialized without error.

Alternative or Verification Steps

  • Run SELECT mirroring_connection_timeout FROM sys.database_mirroring WHERE database_id = DB_ID('YourDatabaseName'); to confirm the active timeout value is within range and successfully applied.
  • If the error persists despite correcting the value, verify there isn’t a separate Availability Group or Always On configuration script conflicting with legacy mirroring syntax, as SQL Server 2025 deprecates classic mirroring in favor of Always On Availability Groups for most production scenarios.

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

Troubleshooting Guide: SQL Server Error 1474 – Database Mirroring Connection Error

Why This Error Happens

Error 1474 occurs when the database mirroring endpoint cannot establish or maintain a TCP connection between the principal and mirror server instances. This is typically caused by a blocked or misconfigured firewall port (default 5022), expired or mismatched SSL/TLS certificates used for endpoint authentication, or the mirroring endpoint being in a STOPPED state. In some cases, this also stems from insufficient permissions on the service account attempting to CONNECT to the mirroring endpoint.

Step-by-Step Resolution Guide

Step 1: Verify the Database Mirroring Endpoint Status

  • Open SQL Server Management Studio (SSMS) and connect to both the Principal and Mirror instances.
  • Run the following query on both servers to check endpoint state:
SELECT name, state_desc, port, encryption_algorithm_desc 
FROM sys.database_mirroring_endpoints;
  • If state_desc shows STOPPED, restart it using:
ALTER ENDPOINT [Mirroring] STATE = STARTED;

Step 2: Check Windows Firewall and Network Connectivity

  • On Windows Server 2025/Windows 11, open Windows Defender Firewall with Advanced Security.
  • Verify an Inbound Rule exists allowing TCP traffic on port 5022 (or your custom mirroring port) for both the Principal and Mirror servers.
  • Test raw connectivity using PowerShell:
Test-NetConnection -ComputerName <MirrorServerName> -Port 5022
  • If the connection fails, add a new rule via wf.msc or run:
New-NetFirewallRule -DisplayName "SQL Mirroring" -Direction Inbound -Protocol TCP -LocalPort 5022 -Action Allow

Step 3: Validate Certificates and Service Account Permissions

  • If using certificate-based authentication, confirm the certificates have not expired by querying sys.certificates.
  • Ensure the SQL Server Service Account (e.g., NT Service\MSSQLSERVER) has CONNECT permissions on the endpoint:
GRANT CONNECT ON ENDPOINT::[Mirroring] TO [DOMAIN\ServiceAccount];
  • Restart the SQL Server Service via services.msc to force the endpoint to re-bind to the network interface.

Step 4: Review SQL Server Error Logs for Specific Sub-Codes

  • Navigate to the log path: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Look for specific OS-level error codes immediately following the 1474 entry (e.g., “An error occurred while receiving data”).
  • Cross-reference these sub-codes with sys.messages to identify if the issue is a DNS resolution failure or a TLS handshake failure.

Alternative or Verification Steps

  • To verify the fix, check the mirroring status in SSMS under Object Explorer > Database Properties > Mirroring; the status should display “Synchronized” rather than “Disconnected.”
  • If the error persists after firewall and certificate checks, try removing and recreating the mirroring session entirely using ALTER DATABASE... SET PARTNER OFF followed by a fresh BACKUP and RESTORE WITH NORECOVERY sequence to rule out metadata corruption.

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

Troubleshooting Guide: Error 1473 – “This SQL Server Edition Does Not Allow Changing the Safety Level”

Why This Error Happens

This error occurs when attempting to modify database mirroring or Always On Availability Group safety/synchronization settings on an edition of SQL Server 2025 that does not support the requested configuration, typically Express, Web, or Standard edition with unsupported synchronous commit options. The ALTER DATABASE command fails because the underlying feature (such as automatic failover safety levels tied to mirroring) has been deprecated or restricted to Enterprise edition only. Additionally, this can surface when database mirroring catalogs are left in a stale state after an incomplete upgrade from a prior SQL Server version.

Step-by-Step Resolution Guide

Step 1: Verify Your SQL Server Edition and Licensing

  • Run the following query to confirm your current edition:
  • SELECT SERVERPROPERTY('Edition') AS Edition, SERVERPROPERTY('EngineEdition') AS EngineEdition;
  • Cross-reference the result against Microsoft’s 2025 Feature Support Matrix to confirm whether “Safety FULL/OFF” mirroring settings are licensed for your edition.
  • If you are on Standard or Web edition, note that legacy SAFETY level changes via ALTER DATABASE are blocked by design.

Step 2: Migrate to a Supported High-Availability Model

  • Since legacy Database Mirroring is deprecated in SQL Server 2025, reconfigure your topology using Always On Availability Groups instead.
  • Open SQL Server Configuration Manager on Windows Server 2025 and enable the Always On Availability Groups service account property under the SQL Server Service tab.
  • Restart the SQL Server service via services.msc or run:
  • net stop MSSQLSERVER && net start MSSQLSERVER

Step 3: Upgrade Edition or Apply Correct Licensing Key

  • If Enterprise-level safety features are required, upgrade the edition using the Installation Center:
  • Navigate to Start > SQL Server 2025 Installation Center > Maintenance > Edition Upgrade.
  • Enter the valid Enterprise or Developer edition product key when prompted.
  • Reboot the instance service to apply the new licensing tier.

Step 4: Clean Up Stale Mirroring Metadata

  • If the edition is already correct but the error persists, purge orphaned mirroring endpoints:
  • ALTER DATABASE [YourDB] SET PARTNER OFF;
  • DROP ENDPOINT [Mirroring_Endpoint];
  • Restart the SQL Server instance to clear cached session states referencing the old safety configuration.

Alternative or Verification Steps

  • After applying the fix, re-run ALTER DATABASE [YourDB] SET SAFETY FULL; (or your original command) to confirm it executes without Error 1473.
  • If the error persists, use sys.database_mirroring system view to check the safety_level column and ensure it matches the expected value (1 for FULL, 0 for OFF) for your specific edition tier.

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

Troubleshooting Guide: Error 1472 — Database Mirroring Connection Terminated

Why This Error Happens

This error occurs when the TCP endpoint used for database mirroring experiences a communications failure between the principal, mirror, and/or witness servers. Common root causes include a firewall or network interruption blocking the mirroring endpoint port, an expired or mismatched SSL/TLS certificate used for endpoint authentication, or the mirroring endpoint being in a STOPPED or DISABLED state on one of the SQL Server instances. It can also occur due to insufficient permissions (CONNECT rights) on the mirroring endpoint for the service account used by the partner server.

Step-by-Step Resolution Guide

Step 1: Verify the Mirroring Endpoint Status and Port

  • Open SQL Server Management Studio (SSMS) and connect to each instance (principal, mirror, witness).
  • Run the following query to check endpoint state:
SELECT name, state_desc, port FROM sys.tcp_endpoints;
  • Ensure the state is STARTED. If not, restart it:
ALTER ENDPOINT [Mirroring] STATE = STARTED;
  • Confirm all servers are using the same port (default is 5022) and note it for firewall checks.

Step 2: Check Windows Firewall and Network Connectivity

  • On Windows Server 2025 / Windows 11, open Windows Defender Firewall with Advanced Security.
  • Create or verify an Inbound Rule allowing TCP traffic on the mirroring port (e.g., 5022) for the sqlservr.exe process.
  • Test connectivity between servers using PowerShell:
Test-NetConnection -ComputerName <PartnerServerName> -Port 5022
  • If the test fails, check for VPN/network ACL issues between the physical or virtual machines.

Step 3: Validate Certificates and Endpoint Authentication

  • If using certificate-based authentication, confirm the certificate has not expired:
SELECT name, expiry_date FROM sys.certificates;
  • Ensure the public key certificates were correctly exchanged and backed up/restored between principal and mirror instances.
  • Re-issue or renew certificates if expired, then re-create the endpoint authentication using:
CREATE ENDPOINT [Mirroring] ... AUTHENTICATION = CERTIFICATE <CertName>;

Step 4: Grant Correct Permissions on the Endpoint

  • Verify the SQL Server service account (or certificate login) has CONNECT permission on the mirroring endpoint:
GRANT CONNECT ON ENDPOINT::[Mirroring] TO [DOMAIN\ServiceAccount];
  • Restart the SQL Server service after granting permissions to ensure the change takes effect.

Step 5: Restart the Mirroring Session

  • On the principal server, pause and resume mirroring to re-establish the connection:
ALTER DATABASE [YourDatabase] SET PARTNER SUSPEND;
ALTER DATABASE [YourDatabase] SET PARTNER RESUME;
  • Monitor the SQL Server Error Log and Windows Event Viewer for confirmation that the mirroring session has resumed without further 1472 errors.

Alternative or Verification Steps

  • Check the Database Mirroring Monitor in SSMS (right-click the database → Tasks → Launch Database Mirroring Monitor) to confirm the session state shows “Synchronized” with no further communication errors.
  • If the issue persists, consider migrating to Always On Availability Groups, which offers more robust connection retry logic and diagnostics compared to legacy database mirroring (deprecated in favor of AGs in newer SQL Server versions).

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

Troubleshooting Guide: Error 1471 – Database Mirroring Connection Terminated (Out of Memory)

Why This Error Happens

Error 1471 occurs when SQL Server’s internal memory allocator fails to reserve sufficient buffer space to send a message across the database mirroring endpoint, typically due to memory pressure from the max server memory setting being configured too restrictively relative to workload demands. This can also happen when the Database Mirroring transport buffer pool is exhausted because of high-latency network links causing message backlog, or when external memory pressure (such as another SQL Server instance or application) is starving the Windows Server 2025 host of available physical RAM. In some cases, fragmented virtual address space (VAS) on the server—especially in 32-bit legacy configurations or heavily extended instances—prevents contiguous memory allocation even when total free memory appears adequate.

Step-by-Step Resolution Guide

Step 1: Verify and Adjust SQL Server Memory Configuration

  • Open SSMS and run EXEC sp_configure 'max server memory' to check the current ceiling.
  • Ensure max server memory leaves at least 2-4 GB of headroom for the OS on Windows Server 2025, especially if other services share the box.
  • Example fix: EXEC sp_configure 'show advanced options', 1; RECONFIGURE; EXEC sp_configure 'max server memory', 16384; RECONFIGURE;
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER for the change to take full effect.

Step 2: Check for Memory Pressure and VAS Fragmentation

  • Open Performance Monitor (perfmon.exe) and add counters for SQLServer:Memory Manager\Memory Grants Pending and SQLServer:Memory Manager\Total Server Memory (KB).
  • Check the SQL Server Error Log (via xp_readerrorlog) for prior “RESOURCE_MEMPHYSICAL” or “Failed Virtual Allocate Bytes” warnings that often precede Error 1471.
  • If running on physical hardware, confirm Windows Server 2025 isn’t reserving excessive memory for Hyper-V or other virtualized workloads sharing the host.

Step 3: Inspect and Tune the Mirroring Endpoint

  • Run SELECT * FROM sys.database_mirroring_endpoints; to confirm the endpoint state is STARTED and not stuck in a retry loop consuming buffer memory.
  • Check the ENCRYPTION algorithm setting on the endpoint (AES is recommended over RC4) since mismatched or outdated encryption can cause excessive message buffering.
  • If the partner server is on a high-latency WAN link, consider switching the mirroring safety level to OFF (asynchronous) temporarily to reduce message queue buildup: ALTER DATABASE [YourDB] SET PARTNER SAFETY OFF;

Step 4: Apply Latest Cumulative Update

  • Navigate to the Microsoft Update Catalog and confirm you are running the latest Cumulative Update (CU) for SQL Server 2025, as memory allocator fixes for mirroring endpoints are frequently patched.
  • Verify your current build with SELECT @@VERSION; and cross-reference against Microsoft’s build version page before and after patching.

Alternative or Verification Steps

  • After applying changes, monitor the SQL Server Error Log and Windows Event Viewer (Application log) for 24-48 hours to confirm Error 1471 does not recur during peak mirroring traffic.
  • If the issue persists, consider migrating from Database Mirroring to Always On Availability Groups, as mirroring is a deprecated feature and AGs have more robust memory management for synchronization traffic.

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

Troubleshooting Guide: Error 1470 – Database Mirroring Partner Configuration

Why This Error Happens

Error 1470 occurs when an ALTER DATABASE statement attempting to modify database mirroring or partner configuration (such as SET PARTNER, SET WITNESS, or safety-level changes) is executed against a server instance that is not currently acting as the principal server for that database. SQL Server 2025 enforces this restriction because partner configuration changes must originate from the principal role to maintain transactional consistency between the principal and mirror copies. This typically happens after an unplanned failover, a manual role switch, or when a script/application retains a stale connection string pointing to what used to be the principal but is now the mirror.

Step-by-Step Resolution Guide

Step 1: Identify the Current Principal Server

  • Connect to either partner instance using SQL Server Management Studio (SSMS) or sqlcmd on Windows Server 2025.
  • Run the following query to check the current mirroring role:
  SELECT 
      DB_NAME(database_id) AS DatabaseName,
      mirroring_role_desc,
      mirroring_state_desc
  FROM sys.database_mirroring
  WHERE database_id = DB_ID('YourDatabaseName');
  • Confirm which server instance shows mirroring_role_desc = 'PRINCIPAL'.

Step 2: Redirect the ALTER DATABASE Command to the Principal Instance

  • Open a new connection in SSMS targeting the confirmed principal server (e.g., SQLPROD01\INSTANCE01).
  • Re-run the original ALTER DATABASE command from this connection:
  ALTER DATABASE [YourDatabaseName] 
  SET PARTNER = 'TCP://MirrorServer.domain.com:5022';
  • Do not attempt to run this command on the mirror instance under any circumstance, even with sysadmin rights.

Step 3: Update Application and Script Connection References

  • Check connection strings, SSIS packages, Agent Jobs, or PowerShell scripts (Invoke-Sqlcmd) that may be hardcoded to the old principal server name or IP.
  • Update any Data Source= or -S server parameters to reflect the current principal, or better, implement a Failover Partner parameter:
  Server=PrimaryServer;Failover Partner=MirrorServer;Database=YourDB;

Step 4: Validate Endpoint and Service Account Health

  • Verify the mirroring endpoint is STARTED on both nodes:
  SELECT name, state_desc, port FROM sys.database_mirroring_endpoints;
  • Confirm the SQL Server service account has matching permissions on both Windows Server 2025 nodes (check via services.msc or Get-Service MSSQLSERVER).
  • Restart the SQL Server Database Engine service only if the endpoint shows STOPPED or DISABLED.

Alternative or Verification Steps

  • After applying the fix, re-run the SELECT * FROM sys.database_mirroring query to confirm mirroring_role_desc shows PRINCIPAL on the server where you executed the ALTER DATABASE command, and mirroring_state_desc shows SYNCHRONIZED.
  • If the role is unclear or flapping, use ALTER DATABASE [YourDatabaseName] SET PARTNER FAILOVER; only from the true principal to force a clean, intentional role switch before retrying the configuration change.

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

Troubleshooting Guide: SQL Server Error 1469 — Auto-Close Database Incompatible with Mirroring/Availability Groups

Why This Error Happens

This error occurs because the database has the AUTO_CLOSE option set to ON, which is fundamentally incompatible with database mirroring and Always On Availability Groups. SQL Server requires databases participating in these high-availability configurations to remain continuously open so that transaction log records and synchronization data can be exchanged between partners without interruption. When AUTO_CLOSE is enabled, the database shuts down and releases its resources after the last user disconnects, which breaks the persistent connection required for mirroring endpoints or AG replica communication.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Database and Confirm AUTO_CLOSE Status

  • Open SQL Server Management Studio (SSMS) and connect to the instance reporting Error 1469.
  • Run the following query to check the current setting:
SELECT name, is_auto_close_on 
FROM sys.databases 
WHERE name = 'YourDatabaseName';
  • A result of 1 in the is_auto_close_on column confirms this is the root cause.

Step 2: Disable AUTO_CLOSE on the Database

  • Execute the following T-SQL command against the target database:
ALTER DATABASE [YourDatabaseName] SET AUTO_CLOSE OFF;
  • If the database is already part of a mirroring session or AG and the command fails, you may need to temporarily remove it from the mirroring/AG configuration first.
  • For databases not yet added to an Availability Group, disable this setting before attempting to join it to the AG.

Step 3: Verify Settings Across All Partner/Replica Instances

  • Since mirroring and AG configurations involve multiple SQL Server instances (principal, mirror, and witness, or primary and secondary replicas), repeat Steps 1 and 2 on every node in the topology.
  • Use SSMS or PowerShell (Invoke-Sqlcmd) to batch-check all replicas in Windows Server 2025 environments running multiple SQL Server 2025 instances.

Step 4: Re-Attempt the Mirroring Setup or AG Database Addition

  • Navigate to SSMS > Always On High Availability > Availability Databases and retry adding the database.
  • For mirroring, re-run the ALTER DATABASE [YourDatabaseName] SET PARTNER = 'TCP://PartnerServer:5022' command.
  • Confirm no errors are returned and check the SQL Server Error Log for successful synchronization messages.

Step 5: Validate AUTO_CLOSE Remains Disabled Post-Configuration

  • SQL Server will prevent re-enabling AUTO_CLOSE on a database that is actively part of an AG or mirroring session, but confirm this behavior by attempting a test change:
ALTER DATABASE [YourDatabaseName] SET AUTO_CLOSE ON;
  • This command should fail with an explicit error if the database is correctly participating in mirroring/AG, confirming the configuration is locked in properly.

Alternative or Verification Steps

  • Run SELECT name, is_auto_close_on FROM sys.databases; on all instances to confirm the value is 0 across the board before and after joining the AG or mirroring session.
  • If the error persists after disabling AUTO_CLOSE, check for Policy-Based Management (PBM) policies or deployment scripts that may be silently re-enabling the setting during database creation or restore operations.

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

Troubleshooting Guide: SQL Server Error 1466 – Database Read-Only Conflict

Why This Error Happens

This error occurs when SQL Server attempts to add a database to an Availability Group or mirroring session, but the database is currently set to READONLY mode on one of the participating instances. Database mirroring and Always On Availability Groups require the primary (and secondary, in most configurations) database to be in READWRITE mode to properly synchronize transaction logs. This mismatch commonly happens after restoring a database from a read-only source, attaching a database with inherited read-only file attributes, or when a database was intentionally set to read-only for reporting purposes and later repurposed for high availability.

Step-by-Step Resolution Guide

Step 1: Verify the Current Database State

  • Open SQL Server Management Studio (SSMS) and connect to the instance reporting the error.
  • Run the following query to check the current read-write status:
  SELECT name, is_read_only FROM sys.databases WHERE name = 'YourDatabaseName';
  • A result of 1 in the is_read_only column confirms the database is set to read-only.

Step 2: Change the Database to Read-Write Mode

  • Ensure no active connections are using the database before proceeding; use ALTER DATABASE ... SET SINGLE_USER if needed to force disconnections.
  • Execute the following T-SQL command to switch the database mode:
  ALTER DATABASE [YourDatabaseName] SET READ_WRITE WITH ROLLBACK IMMEDIATE;
  • If the database is part of a failover cluster instance (FCI) on Windows Server 2025, confirm the change propagates by checking the shared storage LUN properties are not set to read-only at the OS level.

Step 3: Check File System and Volume Permissions

  • On Windows Server 2025 / Windows 11, navigate to the folder containing the .mdf and .ldf files (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).
  • Right-click the database files, select Properties, and ensure the Read-only attribute checkbox is unchecked under the General tab.
  • Verify the SQL Server service account has Modify and Write NTFS permissions on the data and log directories.

Step 4: Retry Adding the Database to the Availability Group

  • Return to Always On High Availability in SSMS Object Explorer.
  • Right-click Availability Group Listeners or the specific AG name, select Add Database, and re-run the wizard.
  • Confirm the database now passes the validation checks without triggering Error 1466.

Alternative or Verification Steps

  • Run SELECT name, is_read_only, state_desc FROM sys.databases; after the fix to confirm the database shows is_read_only = 0 and state_desc = ONLINE.
  • If the error persists, check for Resource Governor or third-party backup tools (e.g., snapshot-based backup agents) that may be re-applying a read-only flag automatically after each backup cycle.

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

Troubleshooting Guide: SQL Server Error 1467 – Database in Emergency/Suspect Mode

Why This Error Happens

Error 1467 occurs when SQL Server detects that a database participating in a mirroring session or Availability Group is marked as SUSPECT or EMERGENCY on one of the partner replicas, typically due to a corrupted transaction log, an interrupted recovery process, or unexpected storage I/O failures. Because mirroring and Availability Groups require both partners to maintain a consistent, recoverable database state, SQL Server blocks the synchronization process entirely until the damaged database is repaired or removed from the topology. This is a protective mechanism to prevent propagating corruption from the unhealthy replica to the healthy one.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Database and Replica

  • Open SQL Server Management Studio (SSMS) and connect to each replica/partner instance.
  • Run the following query to check database state:
  SELECT name, state_desc, is_suspect_bit_set 
  FROM sys.databases 
  WHERE name = 'YourDatabaseName';
  • Confirm which node reports SUSPECT or EMERGENCY in the state_desc column.
  • Check the SQL Server Error Log (Management > SQL Server Logs in SSMS) for the exact timestamp the database entered this state.

Step 2: Remove the Database from the Mirroring/AG Topology

  • Before attempting repairs, you must break the mirroring session or remove the database from the Availability Group to prevent further blocking.
  • For Database Mirroring, run:
  ALTER DATABASE YourDatabaseName SET PARTNER OFF;
  • For an Availability Group, remove the database via SSMS (Always On High Availability > Availability Databases) or run:
  ALTER AVAILABILITY GROUP [YourAGName] REMOVE DATABASE YourDatabaseName;

Step 3: Repair the Suspect/Emergency Database

  • Set the database to EMERGENCY mode (if not already) to allow read-only access for diagnostics:
  ALTER DATABASE YourDatabaseName SET EMERGENCY;
  • Run a consistency check to identify the extent of corruption:
  DBCC CHECKDB (YourDatabaseName) WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is confirmed, set the database to SINGLE_USER mode and run the repair command:
  ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  DBCC CHECKDB (YourDatabaseName, REPAIR_ALLOW_DATA_LOSS);
  ALTER DATABASE YourDatabaseName SET MULTI_USER;
  • Note: REPAIR_ALLOW_DATA_LOSS can cause data loss; always restore from a verified backup if one is available instead of repairing in place.

Step 4: Re-Join the Database to the Mirroring Session or Availability Group

  • Once the database is confirmed healthy via DBCC CHECKDB with zero errors, take a fresh full backup and transaction log backup.
  • Restore this backup chain on the secondary/partner replica using WITH NORECOVERY.
  • Re-establish mirroring:
  ALTER DATABASE YourDatabaseName SET PARTNER = 'TCP://PartnerServer:5022';
  • Or re-add the database to the Availability Group via SSMS using the Add Database Wizard, ensuring automatic seeding or manual restore is selected based on your environment size.

Alternative or Verification Steps

  • Verify the Fix: Re-run SELECT name, state_desc FROM sys.databases; on both partners to confirm the state reads ONLINE and the mirroring/AG dashboard (Always On Dashboard in SSMS) shows a Synchronized status with no warnings.
  • Alternative Solution: If DBCC CHECKDB repair fails or data loss is unacceptable, restore the database entirely from the last known-good full backup plus transaction log backups on the primary, then re-seed the secondary replica from scratch rather than attempting in-place repair.

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

Troubleshooting Guide: Error 1468 – Database Mirroring/Availability Group Operation Conflict

Why This Error Happens

This error occurs because SQL Server 2025 blocks certain operations—such as dropping a database, renaming it, taking it offline, or restoring over it—when that database is actively participating in a Database Mirroring session or is a member of an Availability Group (AG). The engine enforces this restriction to prevent data inconsistency between the principal/primary replica and the mirror/secondary replicas. Essentially, the database’s metadata state is locked into a synchronization role, and until that role is explicitly removed, the standalone administrative command you are trying to run will be rejected.

Step-by-Step Resolution Guide

Step 1: Identify the Current Replication State

  • Open SQL Server Management Studio (SSMS) and connect to the instance via a new query window.
  • Run the following query to check the status: SELECT name, database_id, replica_id, group_database_id FROM sys.databases WHERE name = 'YourDatabaseName';
  • If replica_id is NOT NULL, the database is part of an Availability Group. If it is mirroring without an AG, check mirroring_state_desc in the same sys.databases view.

Step 2: Remove the Database from the Availability Group (If Applicable)

  • Navigate to Object Explorer > Always On High Availability > Availability Groups in SSMS.
  • Right-click the specific Availability Group and select Show Dashboard to confirm the Primary and Secondary replica roles.
  • Execute the T-SQL command on the Primary replica to remove the database: ALTER AVAILABILITY GROUP [YourAGName] REMOVE DATABASE [YourDatabaseName];
  • Note: This command must be run on the Primary replica; it cannot be run on a Secondary.

Step 3: Break the Mirroring Session (If Using Legacy Mirroring)

  • If the database is using classic Database Mirroring (not AG), run this command on the Principal server: ALTER DATABASE [YourDatabaseName] SET PARTNER OFF;
  • Wait approximately 10-15 seconds for the SQL Server Error Log to register the state change to “mirroring is disabled.”
  • Verify the Windows Server 2025 firewall isn’t causing a timeout on the endpoint (default port 5022) which could cause the “OFF” command to hang.

Step 4: Attempt the Original Operation

  • Retry the specific administrative task that triggered the error (e.g., DROP DATABASE, ALTER DATABASE... MODIFY NAME, or RESTORE DATABASE).
  • Ensure you are running SSMS “As Administrator” on your Windows 11 or Windows Server 2025 machine to rule out local UAC permission conflicts interfering with the connection.

Alternative or Verification Steps

  • Verification: Re-run the query from Step 1. The replica_id column should now return NULL, and mirroring_state_desc should display NULL or SUSPENDED, confirming the database is fully standalone.
  • Alternative: If the ALTER AVAILABILITY GROUP command times out due to a broken cluster quorum, use the Failover Cluster Manager on Windows Server 2025 to verify the cluster resource is “Online” before attempting the T-SQL removal again.

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

Troubleshooting Guide: Error 1463 – Database Mirroring Not Available in This SQL Server Edition

Why This Error Happens

This error occurs because database mirroring is a legacy high-availability feature that Microsoft has restricted to Enterprise and Developer editions in modern SQL Server releases, including SQL Server 2025. If your instance is running Standard, Web, or Express edition, the mirroring endpoint and ALTER DATABASE ... SET PARTNER commands will fail because the feature is licensed out at the engine level. Additionally, since Microsoft has deprecated database mirroring in favor of Always On Availability Groups, some edition SKUs have removed the feature entirely regardless of licensing tier.

Step-by-Step Resolution Guide

Step 1: Verify Your Current SQL Server Edition

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Run the following query to confirm the edition:
  SELECT SERVERPROPERTY('Edition') AS Edition, SERVERPROPERTY('EngineEdition') AS EngineEdition;
  • If the result returns “Standard Edition,” “Express Edition,” or “Web Edition,” this confirms mirroring is not supported and licensing is the root cause.

Step 2: Check Deprecation Status in SQL Server 2025

  • Even on Enterprise/Developer editions, confirm mirroring has not been fully deprecated in your specific build.
  • Run SELECT @@VERSION; to check your exact build number.
  • Cross-reference the build against Microsoft’s official deprecation documentation, as SQL Server 2025 may require Always On Availability Groups for all HA scenarios, making mirroring unavailable even on higher-tier editions.

Step 3: Upgrade the Edition (If Licensing Is the Cause)

  • If you confirmed Step 1 shows a non-qualifying edition, use the Edition Upgrade Wizard:
  • Open SQL Server Installation Center from the Start Menu on Windows Server 2025 / Windows 11.
  • Navigate to Maintenance > Edition Upgrade.
  • Enter a valid Enterprise or Developer edition product key when prompted.
  • Restart the SQL Server service via services.msc or run:
  Restart-Service -Name 'MSSQLSERVER'

Step 4: Migrate to Always On Availability Groups (Recommended Alternative)

  • Since mirroring is deprecated, configure an Always On Availability Group instead, which is supported across more editions in SQL Server 2025.
  • Enable the Always On feature via SQL Server Configuration Manager:
  • Right-click the SQL Server service, select Properties > Always On High Availability.
  • Check Enable Always On Availability Groups and restart the service.

Step 5: Reconfigure the Application/Script to Use the Supported Feature

  • Update any connection strings or failover scripts referencing SET PARTNER syntax to instead reference the new Availability Group listener name.
  • Test failover manually using:
  ALTER AVAILABILITY GROUP [AGName] FAILOVER;

Alternative or Verification Steps

  • To verify the fix, re-run SELECT SERVERPROPERTY('Edition'); and confirm it returns “Enterprise Edition” or “Developer Edition,” then attempt the mirroring setup again (or confirm the Availability Group dashboard in SSMS shows a “Healthy” synchronization status).
  • If upgrading the edition is not feasible, use Log Shipping as a budget-friendly alternative for disaster recovery, as it remains supported across all SQL Server 2025 editions, including Standard.

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

Troubleshooting Guide: Error 1464 – Database Mirroring/AG Secondary State Mismatch

Why This Error Happens

This error occurs when SQL Server 2025 attempts to join a database to a mirroring session or Availability Group, but the target database on the secondary/mirror instance is either fully recovered (online) or was restored without the NORECOVERY option. Since mirroring and AG secondaries require the database to remain in a “restoring” state to continuously apply transaction log records, a database that has already completed recovery cannot accept the log stream. This is most commonly caused by using WITH RECOVERY (or omitting the clause, which defaults to recovery) during the initial full backup restore on the secondary replica.

Step-by-Step Resolution Guide

Step 1: Verify the Current Database State

  • Open SQL Server Management Studio (SSMS) connected to the secondary/mirror instance.
  • Run the following query to check the state:
  SELECT name, state_desc, is_in_standby FROM sys.databases WHERE name = 'YourDatabaseName';
  • If state_desc returns ONLINE instead of RESTORING, this confirms the root cause.

Step 2: Drop and Re-Restore the Database with NORECOVERY

  • On the secondary server, drop the incorrectly recovered database:
  DROP DATABASE YourDatabaseName;
  • Re-restore the full backup, explicitly specifying NORECOVERY:
  RESTORE DATABASE YourDatabaseName 
  FROM DISK = 'D:\Backups\YourDatabaseName.bak' 
  WITH NORECOVERY, 
  MOVE 'YourDatabaseName_Data' TO 'D:\SQLData\YourDatabaseName.mdf', 
  MOVE 'YourDatabaseName_Log' TO 'D:\SQLLogs\YourDatabaseName.ldf';
  • Apply any subsequent transaction log backups using WITH NORECOVERY as well to maintain the restoring state.
  • For Database Mirroring, re-run the ALTER DATABASE SET PARTNER command on the principal server to re-sync the endpoint.
  • For Always On Availability Groups, navigate to SSMS > Always On High Availability > Availability Databases, right-click the AG, and select Add Database to re-join it to the secondary replica.
  • Ensure the SQL Server Service Account has the necessary permissions on the backup/restore file paths (check icacls on the backup folder in Windows Server 2025).

Step 4: Check Endpoint and Firewall Configuration

  • Verify the database mirroring endpoint is started: SELECT * FROM sys.database_mirroring_endpoints;
  • Ensure Windows Defender Firewall on Windows Server 2025 allows the specific TCP port (default 5022) used for the mirroring endpoint between the Principal and Mirror instances.

Alternative or Verification Steps

  • Verify the fix: Re-run the state check query from Step 1; state_desc should now show RESTORING, and the AG Dashboard in SSMS should show a green “Synchronized” status.
  • Alternative: If the backup file is corrupted or missing LSNs, perform a fresh Full Backup on the Principal, followed immediately by a Log Backup, and restore both to the secondary using NORECOVERY to reset the Log Sequence Number (LSN) chain.

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

Troubleshooting Guide: SQL Server Error 1465 – Database Not in Full Recovery Mode

Why This Error Happens

This error occurs because database mirroring and Availability Groups in SQL Server 2025 require the FULL recovery model to ensure complete transaction log continuity between the primary and secondary replicas. If a database is set to SIMPLE or BULK_LOGGED recovery, SQL Server cannot guarantee that every transaction log record is preserved for replay on the secondary, so it blocks the mirroring/AG setup. This typically happens when a database was recently created (defaulting to the model database’s recovery setting) or was intentionally switched to SIMPLE for maintenance and never reverted.

Step-by-Step Resolution Guide

Step 1: Verify the Current Recovery Model

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Run the following query to check the current setting:
  SELECT name, recovery_model_desc 
  FROM sys.databases 
  WHERE name = 'YourDatabaseName';
  • Confirm the recovery_model_desc column shows SIMPLE or BULK_LOGGED instead of FULL.

Step 2: Change the Database to Full Recovery Model

  • Execute the following T-SQL command on the primary server instance:
  ALTER DATABASE [YourDatabaseName] SET RECOVERY FULL;
  • Ensure this change is applied on both the primary and secondary instances if you are configuring mirroring (not required on secondary for AGs, as it inherits via the seeding process).

Step 3: Take a Full Backup Immediately

  • Switching to FULL recovery does not start log chain protection until a full backup is taken.
  • Run a full database backup to initialize the log chain:
  BACKUP DATABASE [YourDatabaseName] 
  TO DISK = 'C:\Backups\YourDatabaseName_Full.bak';
  • Follow this with a transaction log backup to ensure the log chain is unbroken:
  BACKUP LOG [YourDatabaseName] 
  TO DISK = 'C:\Backups\YourDatabaseName_Log.trn';

Step 4: Re-attempt the Mirroring or Availability Group Configuration

  • Navigate back to SSMS > Object Explorer > AlwaysOn High Availability or the Database Mirroring wizard.
  • Re-run the setup wizard or re-execute your ADD DATABASE command for the Availability Group:
  ALTER AVAILABILITY GROUP [YourAGName] ADD DATABASE [YourDatabaseName];

Alternative or Verification Steps

  • Verification: Re-run the sys.databases query from Step 1 to confirm recovery_model_desc now reads FULL, then check the AG dashboard in SSMS for a “Synchronized” or “Synchronizing” health status.
  • Alternative: If the setting reverts unexpectedly, check for a maintenance script or SQL Agent job that forces SIMPLE recovery (often used for log-shrinking routines) and disable it before retrying the mirroring setup.

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

Troubleshooting Guide: SQL Server Error 1460 – Database Mirroring Configuration Conflict

Why This Error Happens

This error occurs because the target database on the remote (partner) server already has an active database mirroring endpoint or session configured, either from a previous mirroring setup that was not properly torn down or from a stale mirroring metadata reference left in the database. SQL Server 2025 checks the remote server’s mirroring state before establishing a new partnership, and it blocks the operation if it detects that the database is still registered as a mirror for another session. This commonly happens after a failed failover, an incomplete removal of mirroring, or when restoring a database that previously had mirroring enabled without clearing its mirroring metadata.

Step-by-Step Resolution Guide

Step 1: Verify Current Mirroring State on the Remote Server

  • Connect to the remote (partner) instance using SQL Server Management Studio (SSMS) or sqlcmd.
  • Run the following query to check mirroring status:
  SELECT name, mirroring_state_desc, mirroring_role_desc, mirroring_partner_instance 
  FROM sys.database_mirroring 
  WHERE mirroring_state IS NOT NULL;
  • Confirm whether the target database shows an active or “SUSPENDED” mirroring state.

Step 2: Remove Existing Mirroring Configuration

  • On the remote server, open a new query window in SSMS.
  • Execute the command to break the existing mirroring session:
  ALTER DATABASE [YourDatabaseName] SET PARTNER OFF;
  • If the database is unresponsive or the partner is offline, force removal using:
  ALTER DATABASE [YourDatabaseName] SET PARTNER OFF;
  GO
  • Check Event Viewer under Applications and Services Logs > Microsoft > Windows > SQLSERVER for confirmation that the mirroring endpoint was dropped.

Step 3: Clear Residual Mirroring Metadata

  • If SET PARTNER OFF does not fully clear the state, restart the SQL Server service via Services.msc (SQL Server (MSSQLSERVER)) on both primary and remote servers.
  • Re-run the mirroring status query from Step 1 to confirm mirroring_state_desc now returns NULL.
  • If metadata persists, drop and restore the database from a fresh backup on the remote server to eliminate any orphaned mirroring GUIDs.

Step 4: Re-establish the Mirroring Partnership

  • On the principal server, re-initiate mirroring setup via SSMS:
  • Right-click the database → Tasks → Mirror → Configure Security.
  • Alternatively, use T-SQL on the principal:
  ALTER DATABASE [YourDatabaseName] SET PARTNER = 'TCP://RemoteServer:5022';
  • Ensure the mirroring endpoint port (default 5022) is open in Windows Defender Firewall with Advanced Security on both Windows Server 2025 or Windows 11 machines.

Alternative or Verification Steps

  • Verify the fix by running SELECT * FROM sys.database_mirroring_endpoints; on both servers to confirm only one active endpoint exists per database.
  • If the error persists, consider migrating to Always On Availability Groups, as classic database mirroring is deprecated in SQL Server 2025 and may have inconsistent legacy behavior.

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

Troubleshooting Guide: SQL Server Error 1461 – Database Mirroring Page Repair

Why This Error Happens

Error 1461 is technically an informational message rather than a critical failure—it confirms that SQL Server’s automatic page repair feature successfully fixed a corrupted physical page by copying a clean version from the mirror partner. However, its presence indicates an underlying problem: physical page corruption occurred on the principal (or mirror) database, typically caused by faulty disk I/O subsystems, storage controller firmware bugs, or abrupt power loss during a write operation. If this message recurs frequently, it signals that the root storage layer (SAN, local disk, or virtual disk in Hyper-V/Azure) is unstable and needs immediate hardware-level investigation rather than just database-level remediation.

Step-by-Step Resolution Guide

Step 1: Confirm the Scope of Corruption

  • Open SQL Server Error Log and Windows Event Viewer (Application log) to locate all instances of Error 824 (which usually precedes 1461) alongside the 1461 confirmation message.
  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to verify no additional corruption exists beyond what was auto-repaired.
  • Note the specific %S_PGID (Page ID) value from the error text for cross-referencing with disk sector logs.

Step 2: Audit the Underlying Storage Health

  • Check Windows Server 2025 Event Viewer under System logs for Event ID 153 (I/O delay) or Event ID 129 (Reset to device) which often correlate with mirroring page repairs.
  • On physical hosts, run chkdsk C: /scan (or the relevant data drive letter) to rule out NTFS file system errors.
  • If running on virtualized infrastructure (Hyper-V), verify the integrity of the .vhdx files using Test-VHD -Path "D:\VMs\SQLData.vhdx" in PowerShell.

Step 3: Validate the Mirroring/Always On Configuration

  • Navigate to SQL Server Management Studio (SSMS) > Object Explorer > Always On High Availability to ensure the partner server’s synchronization state is SYNCHRONIZED, not SYNCHRONIZING or DISCONNECTED.
  • Confirm the endpoint port (default 5022) is not being blocked intermittently by Windows Defender Firewall, as packet drops during the repair transfer can cause repeated corruption cycles.
  • Review sys.dm_hadr_auto_page_repair DMV to see a history of all automatic repair attempts:
SELECT * FROM sys.dm_hadr_auto_page_repair 
WHERE database_id = DB_ID('YourDatabaseName');

Step 4: Update Firmware and Drivers

  • Since storage-level corruption is the primary root cause, update RAID controller firmware and disk drivers via Windows Update or the vendor’s dedicated management suite (e.g., Dell OpenManage, HPE iLO).
  • Reboot the physical host after driver updates to ensure the new I/O stack is active before resuming production traffic.

Alternative or Verification Steps

  • Verify the Fix: Re-run DBCC CHECKDB on the affected database; a clean result with zero allocation or consistency errors confirms the page repair was fully successful and no further corruption remains.
  • Alternative Approach: If Error 1461 repeats on the exact same %S_PGID repeatedly, fail over the Always On Availability Group to the secondary replica and run a full DBCC CHECKDB with the REPAIR_ALLOW_DATA_LOSS option on the former primary during a maintenance window, as this indicates a persistent, localized disk sector failure requiring manual intervention beyond automatic mirroring repair.

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

Troubleshooting Guide: Database Mirroring Disabled Due to Failed Redo Operation (Error 1462)

Why This Error Happens

Error 1462 typically occurs when the mirror database encounters a corrupted log record, insufficient disk space, or an I/O failure while attempting to roll forward (redo) transactions received from the principal server. This can also result from abrupt termination of the SQL Server service, storage subsystem errors, or antivirus/backup software locking the transaction log files mid-write. Because the redo thread cannot apply the log records consistently, SQL Server automatically suspends mirroring to prevent data corruption from propagating.

Step-by-Step Resolution Guide

Step 1: Verify the Mirroring and Database State

  • Open SQL Server Management Studio (SSMS) and connect to the mirror server instance.
  • Run the following query to check the mirroring state:
SELECT DB_NAME(database_id) AS DatabaseName, mirroring_state_desc, mirroring_role_desc
FROM sys.database_mirroring
WHERE mirroring_state_desc IS NOT NULL;
  • Check the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the specific LSN (Log Sequence Number) that caused the redo failure.

Step 2: Check Disk Space and File Integrity

  • Confirm the mirror database’s data and log drives have sufficient free space (at least 15-20% recommended).
  • Navigate to the data file location (commonly C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\) and verify the .mdf and .ldf files are not marked read-only or locked by another process.
  • Temporarily disable third-party antivirus or backup agents scanning the DATA folder, as these frequently interrupt redo I/O operations.

Step 3: Resume or Restart the Mirroring Session

  • On the mirror instance, attempt to manually resume mirroring using:
ALTER DATABASE [YourDatabaseName] SET PARTNER RESUME;
  • If the resume command fails with the same error, restart the SQL Server service via services.msc or PowerShell:
Restart-Service -Name 'MSSQLSERVER' -Force
  • Re-check sys.database_mirroring to confirm the state has changed from SUSPENDED to SYNCHRONIZING.

Step 4: Rebuild the Mirror Database (If Corruption Persists)

  • If the redo operation continues to fail due to physical corruption, remove the broken mirroring session:
ALTER DATABASE [YourDatabaseName] SET PARTNER OFF;
  • Take a fresh full backup and transaction log backup from the principal server.
  • Restore both backups on the mirror server using WITH NORECOVERY, then re-establish the mirroring endpoint and partnership from scratch.

Alternative or Verification Steps

  • To verify the fix, query sys.database_mirroring again and confirm mirroring_state_desc reads SYNCHRONIZED or SYNCHRONIZING, and check the Windows Event Viewer (Application Log) for the absence of recurring Event ID 1462 entries over a 30-minute monitoring window.
  • If rebuilding does not resolve the issue, consider migrating to an Always On Availability Group instead of legacy Database Mirroring, as SQL Server 2025 deprecates mirroring in favor of AG for improved redo resilience and automatic corruption recovery.

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

Why This Error Happens

Error 1457 during database mirroring synchronization typically occurs because the mirror session cannot establish a stable connection between the principal and mirror instances, often due to network latency, firewall blocking the endpoint port, or insufficient permissions on the mirroring endpoint login. It can also happen when the database mirroring endpoint is in a STOPPED state or when certificate-based authentication between instances has expired or is mismatched. In some cases, a corrupted transaction log backup chain prevents the mirror database from catching up, causing SQL Server to report a synchronization failure.

Step-by-Step Resolution Guide

Step 1: Verify the Mirroring Endpoint Status

  • Run SELECT * FROM sys.database_mirroring_endpoints; on both the principal and mirror instances.
  • Confirm the state_desc column shows STARTED; if not, run ALTER ENDPOINT [Mirroring] STATE = STARTED;.
  • Check that the endpoint port (default 5022) matches on both servers.

Step 2: Check Firewall and Network Connectivity

  • On Windows Server 2025 / Windows 11, open Windows Defender Firewall with Advanced Security.
  • Create an inbound/outbound rule allowing TCP traffic on port 5022 for sqlservr.exe.
  • Test connectivity using Test-NetConnection -ComputerName <MirrorServerName> -Port 5022 in PowerShell.

Step 3: Validate Login Permissions and Certificates

  • Ensure the service account or certificate used for mirroring has CONNECT permission on the endpoint: GRANT CONNECT ON ENDPOINT::Mirroring TO [DOMAIN\ServiceAccount];.
  • If using certificates, confirm they haven’t expired via SELECT name, expiry_date FROM sys.certificates;.
  • Re-establish the mirroring session using ALTER DATABASE [YourDB] SET PARTNER RESUME; if the session was suspended.

Step 4: Re-sync the Mirror Database

  • If the log chain is broken, take a fresh full backup and transaction log backup of the principal database.
  • Restore both with WITH NORECOVERY on the mirror instance.
  • Re-establish mirroring: ALTER DATABASE [YourDB] SET PARTNER = 'TCP://MirrorServer:5022';.

Alternative or Verification Steps

  • Confirm successful synchronization by checking SQL Server Management Studio > Database Properties > Mirroring page — status should read “Synchronized.”
  • As an alternative, consider migrating to Always On Availability Groups, which offers improved diagnostics and resolves many legacy mirroring endpoint issues in SQL Server 2025.

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

Troubleshooting Guide: Error 1458 – Database Mirroring Principal Copy Error

Why This Error Happens

Error 1458 occurs when the principal server in a SQL Server database mirroring or Always On session cannot communicate properly with the mirror/secondary copy of the database, often due to a broken network connection, endpoint misconfiguration, or certificate/authentication failure between the partners. This can also be triggered by insufficient disk space, a corrupted transaction log, or the mirroring endpoint being stopped or blocked by a firewall rule on Windows Server 2025. In many cases, the underlying issue is a transient network interruption that causes the mirroring session to enter a suspended or error state, which SQL Server then surfaces as Error 1458 on the principal.

Step-by-Step Resolution Guide

Step 1: Verify Mirroring Endpoint Status and Connectivity

  • Run SELECT * FROM sys.database_mirroring_endpoints; on both the principal and mirror instances to confirm the endpoint state is STARTED.
  • Test network connectivity between servers using Test-NetConnection -ComputerName <MirrorServerName> -Port 5022 in PowerShell.
  • Check Windows Firewall rules on both Windows Server 2025 instances to ensure the mirroring port (default 5022) is allowed for inbound/outbound traffic.

Step 2: Inspect SQL Server Error Logs and Mirroring State

  • Open SQL Server Management Studio (SSMS) and navigate to Management > SQL Server Logs to locate the exact timestamp of Error 1458.
  • Run SELECT mirroring_state_desc, mirroring_role_desc FROM sys.database_mirroring WHERE database_id = DB_ID('YourDatabaseName'); to check if the database is SUSPENDED, DISCONNECTED, or SYNCHRONIZING.
  • If suspended, resume mirroring manually with ALTER DATABASE YourDatabaseName SET PARTNER RESUME;.

Step 3: Validate Certificates and Authentication (If Using Certificate-Based Mirroring)

  • Confirm certificates have not expired by running SELECT name, expiry_date FROM sys.certificates; on both servers.
  • Re-issue or renew the mirroring certificates if expired, then re-establish the endpoint authentication using ALTER ENDPOINT with the updated certificate.
  • Restart the SQL Server service via services.msc or Restart-Service MSSQLSERVER after certificate updates.

Step 4: Check Disk Space and Transaction Log Health

  • Verify available disk space on the drive hosting the .ldf transaction log file using File Explorer or Get-PSDrive in PowerShell.
  • Run DBCC SQLPERF(LOGSPACE); to check if the transaction log is nearing capacity, which can halt log shipping to the mirror.
  • If the log is full, back up the transaction log with BACKUP LOG YourDatabaseName TO DISK = 'D:\Backups\YourDatabaseName_log.trn'; to free up space.

Step 5: Re-Establish the Mirroring Session

  • If the above steps don’t resolve it, break the mirroring session with ALTER DATABASE YourDatabaseName SET PARTNER OFF; on the principal.
  • Re-establish mirroring by restoring a fresh full backup and transaction log backup (with NORECOVERY) on the mirror server, then reconfigure the partnership using ALTER DATABASE YourDatabaseName SET PARTNER = 'TCP://MirrorServer:5022';.

Alternative or Verification Steps

  • To confirm the fix worked, re-run SELECT mirroring_state_desc FROM sys.database_mirroring WHERE database_id = DB_ID('YourDatabaseName'); and verify it returns SYNCHRONIZED.
  • If mirroring continues to fail, consider migrating to an Always On Availability Group, which offers more robust failover diagnostics and health monitoring via the AlwaysOn_health Extended Events session.

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

Troubleshooting Guide: SQL Server Error 1459 — Database Mirroring Metadata Access Error

Why This Error Happens

Error 1459 typically occurs when the database mirroring metadata stored in the system catalogs becomes inconsistent, corrupted, or is left in a stale state after an improper failover, abrupt service termination, or a botched mirroring removal attempt. This can also happen when the mirroring endpoint is unreachable, the service account lacks the necessary permissions on the endpoint, or the mirroring session state tables (sys.database_mirroring) were not properly updated during a topology change. In some cases, a mismatch between the principal and mirror server’s internal mirroring GUIDs triggers this metadata validation failure.

Step-by-Step Resolution Guide

Step 1: Verify Current Mirroring State

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run the following query to inspect the mirroring metadata:
  SELECT database_id, mirroring_state_desc, mirroring_role_desc, mirroring_partner_instance 
  FROM sys.database_mirroring 
  WHERE mirroring_guid IS NOT NULL;
  • Note the mirroring_state_desc value — if it shows SUSPENDED, DISCONNECTED, or NULL unexpectedly, this confirms metadata inconsistency.

Step 2: Forcefully Remove the Broken Mirroring Configuration

  • On the affected database, run:
  ALTER DATABASE [YourDatabaseName] SET PARTNER OFF;
  • If this command itself fails with Error 1459, restart the SQL Server service via services.msc or PowerShell:
  Restart-Service -Name 'MSSQLSERVER' -Force
  • Re-attempt the SET PARTNER OFF command immediately after the service restarts, as a fresh service start often clears cached mirroring state.

Step 3: Validate and Clean the Endpoint Configuration

  • Check the mirroring endpoint status on both principal and mirror servers:
  SELECT name, state_desc, port, encryption_algorithm_desc 
  FROM sys.database_mirroring_endpoints;
  • Ensure the endpoint is STARTED and listening on the expected port (default 5022) by confirming with:
  Test-NetConnection -ComputerName <MirrorServerName> -Port 5022
  • If the endpoint is corrupted, drop and recreate it:
  DROP ENDPOINT Mirroring_Endpoint;
  CREATE ENDPOINT Mirroring_Endpoint
  STATE = STARTED
  AS TCP (LISTENER_PORT = 5022)
  FOR DATABASE_MIRRORING (ROLE = PARTNER);

Step 4: Reconfigure Mirroring from Scratch

  • Take a fresh full backup and transaction log backup of the principal database.
  • Restore both to the mirror server using WITH NORECOVERY.
  • Re-establish the partnership on both instances:
  -- On Mirror
  ALTER DATABASE [YourDatabaseName] SET PARTNER = 'TCP://PrincipalServer:5022';

  -- On Principal
  ALTER DATABASE [YourDatabaseName] SET PARTNER = 'TCP://MirrorServer:5022';

Alternative or Verification Steps

  • After reconfiguration, confirm healthy status via SELECT mirroring_state_desc FROM sys.database_mirroring WHERE database_id = DB_ID('YourDatabaseName'); — it should return SYNCHRONIZED.
  • If mirroring continues to fail, consider migrating to Always On Availability Groups, which is the Microsoft-recommended replacement for legacy database mirroring in SQL Server 2025.

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

Troubleshooting Guide: Database Mirroring Suspended — Error 1454

Why This Error Happens

Error 1454 occurs when the principal and mirror server instances lose synchronization due to a broken or unstable connection between them, often caused by network latency, firewall interference, or an endpoint communication failure. This can also result from insufficient disk space on the mirror server, corrupted transaction log records being shipped to the mirror, or the mirroring endpoint being unreachable due to certificate or authentication mismatches. In many cases, the underlying issue is that SQL Server cannot redo logged operations on the mirror database, forcing it to suspend mirroring to prevent data inconsistency.

Step-by-Step Resolution Guide

Step 1: Verify Mirroring Endpoint Connectivity

  • Open SQL Server Configuration Manager and confirm the mirroring endpoint is started on both principal and mirror instances.
  • Run SELECT * FROM sys.database_mirroring_endpoints; on both servers to check the state_desc column equals STARTED.
  • Test network connectivity using Test-NetConnection -ComputerName <MirrorServerName> -Port 5022 in PowerShell to rule out firewall blocking.

Step 2: Check Disk Space and Transaction Log Health

  • Navigate to the data/log file directory (commonly C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\) and confirm free disk space is above 15%.
  • Run DBCC SQLPERF(LOGSPACE); to check if the transaction log on the mirror is near capacity.
  • If log space is critical, back up the transaction log on the principal using BACKUP LOG [YourDB] TO DISK = 'D:\Backups\YourDB_Log.trn'; to free up space.

Step 3: Resume Mirroring Session Manually

  • On the principal server, run ALTER DATABASE [YourDB] SET PARTNER RESUME; to attempt to restart the mirroring session.
  • Check the SQL Server Error Log (via SSMS > Management > SQL Server Logs) for additional context tied to Error 1454, such as a preceding Error 1440 or 1431.
  • If resume fails, restart the Mirroring Endpoint service state using ALTER ENDPOINT [Mirroring] STATE = STARTED; on both instances.

Step 4: Validate Certificate and Authentication Configuration

  • If using certificate-based authentication (common in Windows Server 2025 hardened environments), confirm certificates have not expired via SELECT name, expiry_date FROM sys.certificates;.
  • Re-issue and re-bind certificates on both principal and mirror endpoints if expired, ensuring matching public keys are exchanged correctly.

Alternative or Verification Steps

  • To verify the fix, run SELECT mirroring_state_desc FROM sys.database_mirroring WHERE database_id = DB_ID('YourDB'); and confirm the state reads SYNCHRONIZED.
  • If mirroring still fails to resume, consider removing and reconfiguring the mirroring session from scratch using ALTER DATABASE [YourDB] SET PARTNER OFF; followed by a fresh full backup/restore and SET PARTNER setup sequence.

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

Troubleshooting Guide: SQL Server Error 1455 — Database Mirroring Force Service Failure

Why This Error Happens

Error 1455 occurs when an administrator attempts to force service (ALTER DATABASE ... SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS) on a mirror database that has not received enough transaction log data to safely become the principal. This typically happens because the mirroring session was already in a disconnected or suspended state before the failover attempt, meaning the mirror database is stuck in a RESTORING state that does not qualify as a valid failover target. It can also occur if the database was manually taken offline or if the endpoint connection dropped mid-synchronization, leaving the mirror “out of sync.”

Step-by-Step Resolution Guide

Step 1: Verify the Current Mirroring State

  • Open SQL Server Management Studio (SSMS) and run the following query against the msdb database to check the mirroring status:
SELECT 
    DB_NAME(database_id) AS DatabaseName, 
    mirroring_state_desc, 
    mirroring_role_desc 
FROM sys.database_mirroring 
WHERE mirroring_guid IS NOT NULL;
  • Look specifically for the state SUSPENDED or DISCONNECTED, as FORCE_SERVICE_ALLOW_DATA_LOSS only works correctly when the state is SYNCHRONIZED or in some cases DISCONNECTED but synced recently.

Step 2: Check Windows Server Network and Endpoint Connectivity

  • Since Windows Server 2025 enforces stricter TLS 1.3 defaults, verify the mirroring endpoint certificate hasn’t expired or been rejected.
  • Run netstat -ano | findstr <mirroring_port> (commonly port 5022) on both the Principal and Mirror servers to confirm the endpoint is actively listening.
  • Check the SQL Server Error Log (located by default in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\) for “An error occurred while receiving data” messages, which confirm a dropped connection caused the desync.

Step 3: Correctly Force Service on the Mirror Instance

  • Ensure you are connected directly to the Mirror server instance (not the Principal) before running the command.
  • Execute the force command with the explicit data-loss acceptance clause:
ALTER DATABASE [YourDatabaseName] 
SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS;
  • If the error persists, the mirror is likely too far behind; proceed to Step 4 to break the mirror manually.

Step 4: Break the Mirror and Restore Manually (If Force Service Fails)

  • If the state remains invalid, remove the mirroring configuration entirely to release the lock on the database:
ALTER DATABASE [YourDatabaseName] SET PARTNER OFF;
  • Restore the database with recovery to bring it online as a standalone, usable database:
RESTORE DATABASE [YourDatabaseName] WITH RECOVERY;
  • Re-establish mirroring or pivot to an Always On Availability Group once the primary database is stable.

Alternative or Verification Steps

  • Verify the Fix: Run SELECT state_desc FROM sys.databases WHERE name = 'YourDatabaseName'; and confirm the state reads ONLINE rather than RESTORING or RECOVERY_PENDING.
  • Alternative Solution: If Error 1455 continues to block recovery, consider migrating the workload to an Always On Availability Group (AG), as SQL Server 2025 deprecates legacy mirroring in favor of AG’s more resilient automatic failover and synchronization health checks.

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

Troubleshooting Guide: Error 1456 – Database Mirroring Configuration Failure

Why This Error Happens

Error 1456 occurs when the principal SQL Server instance cannot establish or maintain a connection to the mirror server instance to send the ALTER DATABASE command required for mirroring configuration. This is typically caused by network connectivity issues between the instances, firewall rules blocking the TCP endpoint port used for mirroring, or the database mirroring endpoint being stopped, misconfigured, or lacking proper permissions (CONNECT) for the service account. It can also occur if the endpoint is using an incorrect authentication mode or encryption algorithm mismatch between the principal and mirror instances.

Step-by-Step Resolution Guide

Step 1: Verify Network Connectivity and Firewall Rules

  • Use Test-NetConnection -ComputerName <MirrorServerName> -Port <EndpointPort> in PowerShell on the principal server to confirm the mirroring port (default 5022) is reachable.
  • Check Windows Defender Firewall on both Windows Server 2025/Windows 11 machines and ensure an inbound rule exists for the SQL Server mirroring endpoint port.
  • Navigate to Control Panel > System and Security > Windows Defender Firewall > Advanced Settings > Inbound Rules and confirm TCP port 5022 (or your custom port) is allowed for both Private and Domain profiles.

Step 2: Validate the Database Mirroring Endpoint Status

  • Open SQL Server Management Studio (SSMS) and connect to the mirror instance.
  • Run the following query to check the endpoint state:
SELECT name, state_desc, port, encryption_algorithm_desc 
FROM sys.database_mirroring_endpoints;
  • If the state_desc shows STOPPED, restart it using:
ALTER ENDPOINT [Mirroring] STATE = STARTED;
  • Ensure both principal and mirror endpoints use matching encryption settings (e.g., both set to AES or both DISABLED).

Step 3: Confirm Service Account Permissions

  • Verify the SQL Server service account on both instances has CONNECT permission on the mirroring endpoint.
  • Run this command on both principal and mirror instances, replacing the login as needed:
GRANT CONNECT ON ENDPOINT::[Mirroring] TO [DOMAIN\SQLServiceAccount];
  • If using Windows Authentication across a domain, confirm there is no Kerberos/NTLM misconfiguration by checking SPNs with setspn -L DOMAIN\SQLServiceAccount.

Step 4: Restart SQL Server Services and Retest

  • Restart the SQL Server (MSSQLSERVER or named instance) service on both the principal and mirror servers via services.msc or:
Restart-Service -Name 'MSSQLSERVER'
  • Re-attempt the ALTER DATABASE mirroring command from SSMS or T-SQL to confirm the connection now succeeds.

Alternative or Verification Steps

  • Verify the fix by checking the mirroring status in SSMS under Database Properties > Mirroring, confirming the state reads “Synchronized” or “Synchronizing” instead of showing a connection error.
  • As an alternative, use the Configure Database Mirroring Security Wizard in SSMS to automatically regenerate certificates and endpoint configurations if manual steps fail to resolve the authentication or encryption mismatch.

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

Troubleshooting Guide: SQL Server Error 1451 – Database Mirroring Information Not Found

Why This Error Happens

Error 1451 occurs when SQL Server attempts to reference mirroring metadata in the sys.database_mirroring system table, but the corresponding entry is missing or has become desynchronized. This typically happens after an incomplete mirroring setup, a failed failover, or when the mirroring endpoint was manually dropped without properly removing the database from the mirroring session. It can also surface after an in-place upgrade to SQL Server 2025 on Windows Server 2025/Windows 11 where legacy mirroring catalog entries were not migrated correctly.

Step-by-Step Resolution Guide

Step 1: Verify the Current Mirroring State

  • Open SQL Server Management Studio (SSMS) and connect to the instance reporting the error.
  • Run the following query to inspect the current state:
SELECT database_id, mirroring_state_desc, mirroring_role_desc, mirroring_partner_name
FROM sys.database_mirroring
WHERE mirroring_guid IS NOT NULL;
  • If the target database does not appear in the result set, this confirms the metadata is missing or orphaned.

Step 2: Remove Residual Mirroring Configuration

  • Execute the following command to forcibly strip any partial mirroring state from the database:
ALTER DATABASE [YourDatabaseName] SET PARTNER OFF;
  • If this returns an error due to missing metadata, instead directly drop the endpoint using:
DROP ENDPOINT [Mirroring_Endpoint];
  • Restart the SQL Server service via services.msc or PowerShell:
Restart-Service -Name 'MSSQLSERVER' -Force

Step 3: Rebuild the Mirroring Endpoint and Catalog Entry

  • Recreate the mirroring endpoint with correct port and encryption settings:
CREATE ENDPOINT Mirroring_Endpoint
STATE = STARTED
AS TCP (LISTENER_PORT = 5022)
FOR DATABASE_MIRRORING (ROLE = PARTNER, ENCRYPTION = REQUIRED ALGORITHM AES);
  • Confirm the Windows Firewall (Windows Server 2025/Windows 11) allows inbound traffic on port 5022:
New-NetFirewallRule -DisplayName "SQL Mirroring" -Direction Inbound -Protocol TCP -LocalPort 5022 -Action Allow
  • Re-establish mirroring from the primary server using ALTER DATABASE ... SET PARTNER = 'TCP://PartnerServer:5022'.

Step 4: Check for Corrupted System Catalog Files

  • If the error persists, run DBCC CHECKDB against the master database to rule out catalog corruption:
DBCC CHECKDB('master') WITH NO_INFOMSGS;
  • If corruption is found, restore master from a verified backup, as mirroring metadata resides partially within system catalogs.

Alternative or Verification Steps

  • Confirm the fix by querying sys.database_mirroring_witnesses and sys.database_mirroring again — the target database should now show mirroring_state_desc = SYNCHRONIZED.
  • If mirroring cannot be restored, consider migrating to Always On Availability Groups, which is the recommended replacement architecture in SQL Server 2025 and avoids legacy mirroring catalog issues entirely.

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

Troubleshooting Guide: Error 1452 – Partner Server Instance Name Conflict in SQL Server 2025

Why This Error Happens

This error occurs when the ALTER DATABASE SET PARTNER command attempts to configure database mirroring, but the partner server instance name specified is identical to the principal server instance managing the database. SQL Server requires distinct, uniquely addressable instance names (including network name, port, and instance identifier) for the principal, mirror, and optional witness servers to prevent self-referencing mirroring loops. This commonly happens due to copy-pasted connection strings, incorrect alias configuration in SQL Server Configuration Manager, or DNS/CNAME records that inadvertently resolve both endpoints to the same instance.

Step-by-Step Resolution Guide

Step 1: Verify the Actual Instance Names and Endpoints

  • Open SQL Server Management Studio (SSMS) on both the principal and mirror servers.
  • Run SELECT @@SERVERNAME; and SELECT local_net_address, local_tcp_port FROM sys.dm_exec_connections WHERE session_id = @@SPID; on each server.
  • Confirm the two servers return different network names, IP addresses, or TCP ports (e.g., SQLPROD01:5022 vs. SQLMIRROR01:5023).

Step 2: Correct the ALTER DATABASE Syntax

  • Reissue the command using fully qualified, distinct endpoint addresses:
  ALTER DATABASE [YourDB] SET PARTNER = 'TCP://SQLMIRROR01.domain.com:5023';
  • Ensure you are NOT running this command against the same instance twice (common copy-paste error when scripting both principal and mirror setup).
  • Double-check the mirroring endpoint port numbers configured via sys.database_mirroring_endpoints are unique per instance.

Step 3: Validate Network Aliases and DNS Resolution

  • On Windows Server 2025, open SQL Server Configuration Manager > SQL Native Client Configuration > Aliases.
  • Confirm no alias incorrectly points both the principal and mirror names to the same IP/port combination.
  • Use nslookup or Resolve-DnsName in PowerShell to verify the mirror server’s hostname resolves to a separate IP address than the principal.

Step 4: Restart Mirroring Endpoints and Re-run Configuration

  • On both instances, restart the mirroring endpoint:
  ALTER ENDPOINT [Mirroring] STATE = STARTED;
  • Restart the SQL Server service via Services.msc or Restart-Service MSSQLSERVER in PowerShell (elevated) if endpoint changes were made.
  • Re-run the ALTER DATABASE SET PARTNER command with the corrected, distinct partner address.

Alternative or Verification Steps

  • Verify success by querying SELECT mirroring_state_desc FROM sys.database_mirroring WHERE database_id = DB_ID('YourDB'); — it should show SYNCHRONIZED or SYNCHRONIZING rather than remaining NULL or DISCONNECTED.
  • If the issue persists, drop and recreate the mirroring endpoints entirely using unique port numbers (e.g., 5022 for principal, 5023 for mirror) and reconfigure mirroring from scratch using the New Database Mirroring Wizard in SSMS.

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

Why This Error Happens

Error 1453 (“Partition function ‘%.*ls’ does not exist in the current database”) occurs when SQL Server 2025 attempts to bind a partition scheme to a partition function that cannot be located in the current database context. This typically happens after a database restore, log-shipping failover, or schema migration where the partition function was either not scripted, deployed out of order, or dropped while a dependent partition scheme/table still references it. It can also surface when a cross-database script is executed against the wrong database, since partition functions are database-scoped objects in SQL Server and are not resolved across databases.

Step-by-Step Resolution Guide

Step 1: Verify the Partition Function Exists

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and connect to the affected instance.
  • Run the following query to confirm whether the function is present in the target database:
SELECT name FROM sys.partition_functions WHERE name = 'YourPartitionFunctionName';
  • If no rows are returned, the function is missing from this database context.

Step 2: Confirm You Are in the Correct Database Context

  • Check the active database in the query window (top-left dropdown in SSMS, or run SELECT DB_NAME();).
  • Partition functions and schemes are database-scoped objects in SQL Server 2025 — a function created in DB_A will not be visible in DB_B.
  • Switch context using USE [YourDatabaseName]; before re-running the schema deployment script.

Step 3: Re-Create the Partition Function Before the Partition Scheme

  • Open the original deployment/migration script and ensure the CREATE PARTITION FUNCTION statement executes before any CREATE PARTITION SCHEME or ALTER TABLE ... SWITCH statement referencing it.
  • Example corrected order:
CREATE PARTITION FUNCTION pfYourFunction (int)
AS RANGE LEFT FOR VALUES (100, 200, 300);

CREATE PARTITION SCHEME psYourScheme
AS PARTITION pfYourFunction
ALL TO ([PRIMARY]);
  • Save the corrected script to C:\SQLScripts\PartitionFix.sql and execute it against the target database.

Step 4: Check for Orphaned Dependencies After Restore/Migration

  • If this occurred after a RESTORE DATABASE or sp_detach_db/sp_attach_db operation, confirm the backup used included the full schema (not just a filegroup-level or partial restore).
  • Run DBCC CHECKDB on the restored database to rule out metadata corruption affecting system catalog views (sys.partition_functions, sys.partition_schemes).

Step 5: Redeploy via SSDT or dacpac (If Using Schema Projects)

  • If managing schema via SQL Server Data Tools (SSDT), rebuild and republish the .dacpac file to ensure partition functions are deployed in correct dependency order.
  • In Visual Studio: Build → Deploy, then verify the deployment log for object creation sequence.

Alternative or Verification Steps

  • Verify the fix by re-running SELECT name FROM sys.partition_functions; and SELECT name FROM sys.partition_schemes; to confirm both objects now exist and are properly linked via sys.destination_data_spaces.
  • If the error persists, drop any orphaned partition scheme with DROP PARTITION SCHEME psYourScheme;, then recreate both the function and scheme from scratch in a single transaction to avoid dependency ordering issues.

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

Troubleshooting Guide: SQL Server Error 1448 – Remote Database Mirror Not Found

Why This Error Happens

Error 1448 typically occurs during database mirroring or Always On configuration when the principal server cannot locate the specified database on the mirror/secondary instance. This usually happens because the database name was mistyped, the database was never restored with NORECOVERY on the remote instance, or the mirroring endpoint is pointing to the wrong server/instance. In some cases, the remote database exists but was accidentally brought online (recovered), making it ineligible to act as a mirror target.

Step-by-Step Resolution Guide

Step 1: Verify Database Name and Existence on the Remote Instance

  • Connect to the remote (mirror/secondary) SQL Server 2025 instance using SSMS or sqlcmd.
  • Run SELECT name, state_desc FROM sys.databases; to confirm the exact database name and state.
  • Ensure the name matches exactly (case sensitivity and whitespace) with what was specified in the ALTER DATABASE or mirroring setup command on the principal.

Step 2: Confirm the Remote Database Is in NORECOVERY State

  • Check the state_desc column from Step 1 — it must show RESTORING, not ONLINE.
  • If the database shows ONLINE, it was recovered prematurely and cannot serve as a mirror target.
  • Restore the full backup and subsequent log backups again using:
  RESTORE DATABASE [YourDB] FROM DISK = 'C:\Backups\YourDB.bak' WITH NORECOVERY;
  RESTORE LOG [YourDB] FROM DISK = 'C:\Backups\YourDB_log.trn' WITH NORECOVERY;

Step 3: Validate Mirroring Endpoint and Network Configuration

  • On both principal and mirror instances, verify the endpoint is correctly configured:
  SELECT name, port, state_desc FROM sys.tcp_endpoints;
  • Confirm the mirror server name used in ALTER DATABASE [YourDB] SET PARTNER = 'TCP://MirrorServer:5022' matches the actual FQDN or hostname resolvable via DNS.
  • Check Windows Firewall rules on Windows Server 2025 to ensure port 5022 (or your custom mirroring port) is open for inbound/outbound TCP traffic.

Step 4: Reissue the Mirroring Command

  • Once the database is confirmed in RESTORING state and the endpoint/network path is validated, reissue the command from the principal server:
  ALTER DATABASE [YourDB] SET PARTNER = 'TCP://MirrorServer:5022';
  • Monitor the SQL Server Error Log and Windows Event Viewer (Application log) for confirmation that mirroring has started successfully.

Alternative or Verification Steps

  • Run SELECT * FROM sys.database_mirroring WHERE mirroring_state_desc IS NOT NULL; on the principal to confirm the mirroring session is synchronizing correctly.
  • If the issue persists, drop and recreate the mirroring endpoint on both servers, then redo the full backup/restore sequence with NORECOVERY before reattempting the SET PARTNER command.

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

Troubleshooting Guide: SQL Server Error 1449 — Invalid Server Connection String During ALTER DATABASE

Why This Error Happens

Error 1449 typically occurs when the ALTER DATABASE statement references a linked server or remote data source using a malformed or outdated connection string, often after a server rename, IP change, or migration. This can also happen when the registry entries or SQL Server Configuration Manager network settings contain stale alias information that no longer matches the actual server name recorded in sys.servers. In some cases, corrupted metadata in the system catalog views prevents SQL Server from resolving the local server name correctly, triggering this failure even on syntactically valid commands.

Step-by-Step Resolution Guide

Step 1: Verify the Local Server Name Registration

  • Open a new query window in SQL Server Management Studio (SSMS) and run SELECT @@SERVERNAME; to check the registered name.
  • Compare this output against the actual machine name using SELECT SERVERPROPERTY('MachineName'); in Windows Server 2025/Windows 11.
  • If the names do not match (common after a server rename or VM clone), this mismatch is likely the root cause of Error 1449.

Step 2: Drop and Re-register the Server Name

  • Run sp_dropserver 'OldServerName'; to remove the incorrect, cached server name.
  • Immediately re-register the correct name using sp_addserver 'NewServerName', 'local';.
  • Restart the SQL Server service via services.msc or run net stop MSSQLSERVER && net start MSSQLSERVER in an elevated Command Prompt.

Step 3: Inspect and Repair Linked Server Connection Strings

  • Navigate to Object Explorer > Server Objects > Linked Servers in SSMS.
  • Right-click each linked server tied to the database being altered and select Properties, checking the Server type and Data source fields for outdated hostnames or IP addresses.
  • Update the connection string manually using:
  EXEC sp_serveroption 'LinkedServerName', 'connect timeout', '60';
  EXEC sp_dropserver 'LinkedServerName';
  EXEC sp_addlinkedserver 'LinkedServerName', 'SQLNCLI', 'LinkedServerName';

Step 4: Clear Configuration Manager Alias Cache

  • Open SQL Server Configuration Manager and go to SQL Native Client Configuration > Aliases.
  • Delete any alias entries pointing to deprecated server names or incorrect TCP/IP ports (default is 1433).
  • Confirm the SQL Server Network Configuration > Protocols settings list TCP/IP as enabled with the correct static port bound.

Alternative or Verification Steps

  • After applying the fix, re-run the original ALTER DATABASE command in a fresh query session to confirm Error 1449 no longer appears.
  • If the issue persists, run DBCC CHECKDB against the master database to rule out system catalog corruption as an underlying cause.

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

Troubleshooting Guide: SQL Server Error 1450 — “ALTER DATABASE Failed Because the Worker Thread Cannot Be Created”

Why This Error Happens

This error typically occurs when SQL Server 2025 has exhausted its available worker thread pool, often due to the max worker threads configuration being set too low or the system experiencing memory pressure that prevents new threads from being allocated. It can also surface when the operating system itself is low on non-paged pool memory or when a large number of concurrent connections/requests are competing for the same thread resources during the ALTER DATABASE operation. In some cases, this is a symptom of thread starvation caused by blocking sessions or runaway queries that never release their worker threads back to the pool.

Step-by-Step Resolution Guide

Step 1: Check Current Worker Thread Configuration

  • Run sp_configure 'max worker threads' in SQL Server Management Studio (SSMS) to view the current value.
  • A value of 0 means SQL Server auto-configures threads based on CPU count; verify this hasn’t been manually overridden to a restrictively low number.
  • Cross-reference with sys.dm_os_sys_info by querying the max_workers_count column.

Step 2: Review System Resource Utilization

  • Open Task Manager or Performance Monitor (PerfMon) on Windows Server 2025 / Windows 11 and check for high CPU, memory, or handle usage tied to sqlservr.exe.
  • Check the Windows Event Viewer (Applications and Services Logs > MSSQLSERVER) for correlating out-of-memory or resource exhaustion warnings around the same timestamp as Error 1450.
  • Confirm available non-paged pool memory using PerfMon counter Memory > Pool Nonpaged Bytes; sustained high usage indicates OS-level thread starvation.

Step 3: Identify and Kill Blocking Sessions

  • Execute sp_who2 or query sys.dm_exec_requests to identify long-running or blocked sessions consuming worker threads unnecessarily.
  • Use SELECT * FROM sys.dm_os_waiting_tasks to pinpoint sessions stuck in a wait state (e.g., THREADPOOL wait type is a direct indicator of this issue).
  • Terminate problematic sessions using KILL <session_id> only after confirming they are not critical transactions.

Step 4: Increase Max Worker Threads or Restart the SQL Service

  • If thread count is manually capped too low, reset it to 0 (auto-configure) using:
  EXEC sp_configure 'max worker threads', 0;
  RECONFIGURE WITH OVERRIDE;
  • If the server is already under extreme load, perform a controlled restart of the SQL Server service via SQL Server Configuration Manager to clear the stuck thread pool.
  • Ensure the Windows Server 2025 host has sufficient physical RAM allocated to the SQL Server instance under Server Properties > Memory.

Step 5: Apply Latest Cumulative Update (CU)

  • Verify your SQL Server 2025 build number via SELECT @@VERSION and compare against the latest Cumulative Update from Microsoft’s official release notes.
  • Install any pending CU, as thread pool exhaustion bugs are frequently patched in maintenance releases.

Alternative or Verification Steps

  • After applying fixes, re-run the original ALTER DATABASE command during an off-peak window and confirm it completes without Error 1450.
  • As an alternative, monitor sys.dm_os_waiting_tasks for 15–20 minutes post-fix to ensure the THREADPOOL wait type no longer appears, confirming the thread starvation issue is resolved.

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

Troubleshooting Guide: SQL Server Error 1445 – Database Mirroring Quorum Loss

Why This Error Happens

This error occurs when the SQL Server Database Engine cannot establish or maintain a quorum between the principal, mirror, and witness instances in a mirroring session, causing it to mark the database as inaccessible rather than risk data divergence. The root cause is typically a broken network communication path (firewall blocking the mirroring endpoint port), a stopped or unreachable partner/witness instance, or a mismatched/expired certificate used for endpoint authentication. In Windows Server 2025 environments, this is also frequently triggered by TLS 1.3 enforcement changes affecting the TCP endpoint handshake between mirroring partners.

Step-by-Step Resolution Guide

Step 1: Verify Endpoint Connectivity Between Partners

  • Open SQL Server Configuration Manager and confirm the Database Mirroring Endpoint is in a STARTED state on all instances (principal, mirror, witness).
  • Run SELECT * FROM sys.database_mirroring_endpoints; on each instance to confirm state_desc = STARTED.
  • Test raw network connectivity using Test-NetConnection -ComputerName <PartnerServer> -Port 5022 in PowerShell (replace 5022 with your configured mirroring port).
  • Check Windows Defender Firewall (wf.msc) on Windows Server 2025 for inbound/outbound rules blocking the mirroring TCP port.

Step 2: Validate Certificates and Authentication

  • If using certificate-based authentication, confirm certificates have not expired by running SELECT name, expiry_date FROM sys.certificates;.
  • Re-issue and re-exchange certificates between principal and mirror if expired, using CREATE CERTIFICATE and BACKUP CERTIFICATE.
  • Ensure the SQL Server Service Account has not changed; mismatched service accounts break Windows Authentication-based endpoint trust.
  • Restart the SQL Server service after certificate updates: Restart-Service -Name 'MSSQLSERVER'.

Step 3: Check Witness Server Health (If Configured)

  • Confirm the Witness instance is online and reachable, since loss of quorum often stems from an unreachable witness in high-safety mode.
  • Query mirroring status: SELECT mirroring_state_desc, mirroring_witness_state_desc FROM sys.database_mirroring WHERE database_id = DB_ID('YourDB');
  • If the witness is permanently decommissioned, remove it with: ALTER DATABASE YourDB SET WITNESS OFF;

Step 4: Manually Resume or Re-establish the Mirroring Session

  • If the partners can now communicate, force a resume with: ALTER DATABASE YourDB SET PARTNER RESUME;
  • If the session is unrecoverable, break mirroring and reconfigure: ALTER DATABASE YourDB SET PARTNER OFF;
  • Re-run full backup and log backup restores with NORECOVERY on the mirror before re-establishing: ALTER DATABASE YourDB SET PARTNER = 'TCP://MirrorServer:5022';

Step 5: Review SQL Server Error Logs and Event Viewer

  • Open %ProgramFiles%\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for additional context around Error 1445.
  • Cross-reference Windows Event Viewer (Application Log) on Windows Server 2025 for related network or certificate alerts occurring at the same timestamp.

Alternative or Verification Steps

  • Confirm resolution by querying sys.database_mirroring and verifying mirroring_state_desc returns SYNCHRONIZED instead of SUSPENDED or DISCONNECTED.
  • If mirroring remains unstable after these steps, consider migrating to an Always On Availability Group, as Database Mirroring is deprecated and may have reduced compatibility guarantees on SQL Server 2025.

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

Troubleshooting Guide: Error 1446 – “Server Instance Already Acting as the Witness”

Why This Error Happens

This error occurs when you attempt to configure a SQL Server instance as a witness for a database mirroring session while it is already serving as the witness for another mirroring partnership. SQL Server enforces a one-to-one relationship between a witness instance and the mirroring session it supports, so attempting to reuse the same instance for a second, distinct mirroring configuration without removing the prior assignment triggers this conflict. This is typically caused by leftover mirroring metadata from a previous setup that was not properly decommissioned, or by administrators mistakenly pointing two different mirroring sessions to the same witness server.

Step-by-Step Resolution Guide

Step 1: Identify the Current Witness Role Assignment

  • Connect to the SQL Server instance via SQL Server Management Studio (SSMS) or sqlcmd.
  • Run the following query to check existing mirroring witness roles:
  SELECT name, mirroring_role_desc, mirroring_witness_name 
  FROM sys.database_mirroring 
  WHERE mirroring_role_desc IS NOT NULL;
  • Confirm which database(s) currently list this instance as the witness.

Step 2: Remove the Existing Witness Configuration

  • On the database currently using this instance as a witness, run:
  ALTER DATABASE [YourDatabaseName] SET WITNESS OFF;
  • Verify no other mirroring session on this instance references the witness role by re-running the query from Step 1.
  • Restart the SQL Server (MSSQLSERVER) service via services.msc or PowerShell:
  Restart-Service -Name 'MSSQLSERVER' -Force

Step 3: Reconfigure the Witness for the Correct Mirroring Session

  • In SSMS, navigate to Database Properties > Mirroring for the correct database pair.
  • Specify the witness server instance name only once, ensuring it is not already tied to another active session.
  • Alternatively, run the T-SQL command directly:
  ALTER DATABASE [YourDatabaseName] 
  SET WITNESS = 'TCP://WitnessServerName:5022';

Step 4: Clear Orphaned Endpoint Bindings (If Issue Persists)

  • Check for orphaned mirroring endpoints using:
  SELECT * FROM sys.database_mirroring_endpoints;
  • If duplicate or stale endpoints exist, drop and recreate the endpoint:
  DROP ENDPOINT Mirroring;
  CREATE ENDPOINT Mirroring 
  STATE = STARTED 
  AS TCP (LISTENER_PORT = 5022) 
  FOR DATABASE_MIRRORING (ROLE = WITNESS);

Alternative or Verification Steps

  • Verify the fix by querying sys.database_mirroring again to confirm the witness role is correctly assigned to only one active mirroring session.
  • If the error persists, use SQL Server Configuration Manager to fully stop the instance, clear cached endpoint configurations under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQLServer, and restart the service before reapplying the witness configuration.

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

Troubleshooting Guide: Error 1447 – “ALTER DATABASE Command Cannot Be Executed Until Both Partner Server Instances Are Up”

Why This Error Happens

This error occurs in Microsoft SQL Server 2025 when a database mirroring or Always On configuration command is issued while one of the partner instances (principal or mirror) is offline, unreachable, or has not fully established its endpoint connection. It typically stems from the SQL Server service being stopped on one partner, a blocked or misconfigured TCP endpoint port, or network/firewall rules preventing the two instances from completing the mirroring handshake. Without both instances actively communicating over the mirroring endpoint, SQL Server cannot validate or synchronize the ALTER DATABASE command across the partnership.

Step-by-Step Resolution Guide

Step 1: Verify Both SQL Server Instances Are Running

  • Open Services.msc on both Windows Server 2025 / Windows 11 machines hosting the partner instances.
  • Confirm the SQL Server (MSSQLSERVER) or named instance service status is “Running” on both nodes.
  • If stopped, right-click and select Start, then check the SQL Server Error Log for startup failures.

Step 2: Confirm the Database Mirroring Endpoint Is Active

  • Run the following query on each instance to check endpoint state:
  SELECT name, state_desc, port FROM sys.database_mirroring_endpoints;
  • Ensure state_desc returns STARTED. If it shows STOPPED, start it manually:
  ALTER ENDPOINT [Mirroring] STATE = STARTED;

Step 3: Check Network Connectivity and Firewall Rules

  • Use Test-NetConnection -ComputerName <PartnerServerName> -Port <MirroringPort> in PowerShell on both servers to confirm the mirroring port (default 5022) is reachable.
  • In Windows Defender Firewall with Advanced Security, verify an inbound rule exists allowing TCP traffic on the mirroring endpoint port for both instances.
  • Temporarily disable third-party firewalls or antivirus software to rule out interference, then re-test connectivity.

Step 4: Validate Partner Instance Configuration

  • On both instances, run:
  SELECT database_id, mirroring_state_desc, mirroring_partner_instance 
  FROM sys.database_mirroring 
  WHERE database_id = DB_ID('YourDatabaseName');
  • Confirm mirroring_partner_instance correctly points to the FQDN or IP of the opposite server, not a stale or incorrect hostname.

Step 5: Re-issue the ALTER DATABASE Command

  • Once both services are confirmed running and endpoints are STARTED, retry the original command:
  ALTER DATABASE [YourDatabaseName] SET PARTNER FAILOVER;
  • Monitor the SQL Server Error Log on both partners for successful partnership synchronization messages.

Alternative or Verification Steps

  • Verify the fix by querying sys.database_mirroring on both partners — mirroring_state_desc should display SYNCHRONIZED instead of DISCONNECTED or SUSPENDED.
  • If mirroring remains broken after these steps, consider migrating to an Always On Availability Group configuration, which offers more robust automatic failover and health monitoring than legacy database mirroring in SQL Server 2025.

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

Troubleshooting Guide: Error 1442 – Database Mirroring Inactive

Why This Error Happens

Error 1442 is raised when SQL Server detects that database mirroring has been configured for a database but the mirroring session is not currently active. This typically occurs after a manual suspension of mirroring, a failover event, or when the mirroring endpoint connection between the principal and mirror servers has been dropped due to network interruption or service restart. In most cases, this is a benign, informational message, but it can indicate an underlying endpoint, certificate, or connectivity issue if mirroring does not resume automatically.

Step-by-Step Resolution Guide

Step 1: Verify Current Mirroring Status

  • Open SQL Server Management Studio (SSMS) and connect to the principal server instance.
  • Run the following query to check the mirroring state:
  SELECT database_id, mirroring_state_desc, mirroring_role_desc 
  FROM sys.database_mirroring 
  WHERE mirroring_guid IS NOT NULL;
  • Confirm whether the state is SUSPENDED, DISCONNECTED, or SYNCHRONIZED.

Step 2: Check the Mirroring Endpoints

  • On both the principal and mirror instances, verify the endpoint status:
  SELECT name, state_desc, port, protocol_desc 
  FROM sys.tcp_endpoints 
  WHERE type_desc = 'DATABASE_MIRRORING';
  • Ensure the endpoint state_desc shows STARTED on both servers.
  • If stopped, restart it using:
  ALTER ENDPOINT [Mirroring] STATE = STARTED;

Step 3: Validate Network and Firewall Connectivity

  • On Windows Server 2025 / Windows 11, open Windows Defender Firewall with Advanced Security.
  • Confirm that the mirroring port (commonly 5022) is allowed for inbound and outbound TCP traffic on both the principal and mirror machines.
  • Test connectivity between servers using:
  Test-NetConnection -ComputerName <MirrorServerName> -Port 5022

Step 4: Resume the Mirroring Session

  • If mirroring was manually suspended, resume it with:
  ALTER DATABASE [YourDatabaseName] SET PARTNER RESUME;
  • Monitor the SQL Server Error Log and Windows Event Viewer (Application log) for confirmation that mirroring has resumed successfully.

Step 5: Re-Validate Certificates (If Using Certificate-Based Authentication)

  • Check certificate expiration dates on both instances:
  SELECT name, expiry_date FROM sys.certificates;
  • If expired or mismatched, regenerate and re-exchange certificates between the principal, mirror, and witness (if applicable).

Alternative or Verification Steps

  • Re-run the sys.database_mirroring query from Step 1 and confirm mirroring_state_desc returns SYNCHRONIZED or SYNCHRONIZING.
  • If mirroring still fails to resume, consider removing and reconfiguring the mirroring session entirely using ALTER DATABASE SET PARTNER OFF followed by a fresh mirroring setup, or migrate to Always On Availability Groups for improved reliability on SQL Server 2025.

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

Troubleshooting Guide: SQL Server Error 1443 – Database Mirroring Terminated

Why This Error Happens

Error 1443 occurs when the database mirroring session between the principal and mirror server instances is intentionally or unexpectedly broken, often due to a network connectivity failure, endpoint timeout, or a manual failover/suspend action. This can also result from the mirroring endpoint being unreachable due to firewall restrictions on Windows Server 2025 or a certificate mismatch during the TCP handshake. While SQL Server logs this as an informational message, repeated occurrences typically indicate underlying instability in the mirroring endpoint configuration or network latency between partners.

Step-by-Step Resolution Guide

Step 1: Verify Mirroring Endpoint Status and Connectivity

  • Check the status of the database mirroring endpoint on both the principal and mirror instances using SELECT * FROM sys.database_mirroring_endpoints;
  • Ensure the endpoint STATE is set to STARTED on both servers; if STOPPED, restart it with ALTER ENDPOINT [Mirroring] STATE = STARTED;
  • Test basic network connectivity between the two servers using Test-NetConnection -ComputerName <PartnerServer> -Port 5022 in PowerShell.

Step 2: Review Windows Firewall and Port Configuration

  • Confirm that the mirroring port (default 5022, or your custom port) is open on both Windows Server 2025 instances.
  • Navigate to Windows Defender Firewall with Advanced Security > Inbound Rules and create a new rule allowing TCP traffic on the mirroring port.
  • Run netsh advfirewall firewall add rule name="SQL Mirroring" dir=in action=allow protocol=TCP localport=5022 if a rule does not already exist.

Step 3: Validate Certificates and Authentication

  • If using certificate-based authentication for mirroring, verify that the certificates have not expired using SELECT name, expiry_date FROM sys.certificates;
  • Ensure the certificate’s public key on the principal matches the one imported on the mirror server and vice versa.
  • Re-create and re-exchange certificates if a mismatch or expiration is found, then re-run the CREATE ENDPOINT statements on both partners.

Step 4: Check SQL Server Error Logs and Extended Events

  • Open SQL Server Management Studio (SSMS) and review the SQL Server Logs under Management > SQL Server Logs for repeated 1443 entries or related timeout errors (Error 1413, 1404).
  • Enable an Extended Events session to trace mirroring_state_change events for deeper diagnostic data on why the session terminated.
  • Correlate timestamps with network monitoring tools to rule out packet loss or latency spikes during the termination window.

Step 5: Re-establish the Mirroring Session

  • If the mirroring session remains broken, resume it manually by running ALTER DATABASE <YourDatabase> SET PARTNER RESUME; on the principal server.
  • If resuming fails, you may need to re-initialize mirroring by restoring a fresh backup with NORECOVERY on the mirror and re-issuing the ALTER DATABASE <YourDatabase> SET PARTNER = 'TCP://<MirrorServer>:5022'; command.

Alternative or Verification Steps

  • Verify the fix by querying SELECT mirroring_state_desc FROM sys.database_mirroring WHERE database_id = DB_ID('<YourDatabase>'); and confirming the state reads SYNCHRONIZED.
  • As an alternative, if traditional mirroring continues to fail intermittently, consider migrating to an Always On Availability Group, which offers more robust failover detection and diagnostic logging on Windows Server 2025.

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

Troubleshooting Guide: Error 1444 — “Bypassing Recovery for Mirrored Database”

Why This Error Happens

This message is an informational log entry, not a fatal error, raised when SQL Server 2025 starts up and detects a database flagged with the mirroring state in sys.databases. Because mirrored databases rely on the partner server for recovery coordination, SQL Server intentionally skips the standard recovery (CHECKDB/rollback-rollforward) process to prevent transaction log conflicts with the principal. It most commonly appears when the mirroring session is broken, orphaned, or the partner endpoint is unreachable, leaving the database stuck in a “Mirror, Restoring…” state during service restart.

Step-by-Step Resolution Guide

Step 1: Confirm the Mirroring State and Role

  • Open SSMS and run SELECT name, state_desc, mirroring_state_desc FROM sys.databases WHERE name = 'YourDB';
  • Check Event Viewer (Windows Logs > Application) alongside SQL Server Error Log for Event ID 1444 and correlating mirroring timeout messages (Error 1479 or 1443).
  • Identify whether this instance is currently the Principal, Mirror, or has become orphaned after a failover.

Step 2: Verify Network and Endpoint Connectivity

  • Run SELECT * FROM sys.database_mirroring_endpoints; to confirm the endpoint is STARTED and listening on the correct port (default 5022).
  • Test connectivity between partner servers using Test-NetConnection -ComputerName <PartnerServer> -Port 5022 in PowerShell.
  • Check Windows Firewall rules on both Windows Server 2025 nodes to ensure the mirroring port isn’t blocked.

Step 3: Remove Mirroring If the Partner Is Permanently Lost

  • If the partner server is decommissioned or unrecoverable, break mirroring manually:
  • ALTER DATABASE YourDB SET PARTNER OFF;
  • This releases the database from the mirroring configuration, allowing normal recovery to resume on next restart.

Step 4: Restore the Database to a Usable State

  • If the database remains in “Restoring” state after removing the partner, bring it online with:
  • RESTORE DATABASE YourDB WITH RECOVERY;
  • If log files are missing or corrupted, restore from the last known good full backup plus transaction log backups instead.

Step 5: Re-establish Mirroring (Optional)

  • If mirroring is still required, reconfigure it from scratch following a fresh full backup and log backup restore with NORECOVERY on the mirror instance.
  • Re-run ALTER DATABASE YourDB SET PARTNER = 'TCP://NewPartner:5022'; on the principal.

Alternative or Verification Steps

  • Run SELECT name, state_desc FROM sys.databases; after restart to confirm the database shows ONLINE rather than RESTORING or SUSPECT.
  • If mirroring cannot be restored and the database is critical, consider migrating to Always On Availability Groups (the recommended replacement technology in SQL Server 2025, as classic mirroring is deprecated).

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

Troubleshooting Guide: Error 1439 – “There is currently no witness associated with database”

Why This Error Happens

This error occurs when a database mirroring session is configured for High-Safety mode with automatic failover, but the witness server reference has been lost, removed, or was never properly established in the mirroring topology. This typically happens due to the witness instance being unreachable, the endpoint configuration being corrupted, or someone issuing a command (like ALTER DATABASE SET WITNESS OFF) that stripped the witness role without updating dependent client applications or scripts. It can also surface when SQL Server 2025’s mirroring metadata becomes out of sync after a failed upgrade or service account permission change on the endpoint.

Step-by-Step Resolution Guide

Step 1: Verify Current Mirroring State and Witness Status

  • Run the following query on the principal server to check mirroring status:
  SELECT database_id, mirroring_state_desc, mirroring_witness_name, mirroring_witness_state_desc 
  FROM sys.database_mirroring WHERE database_id = DB_ID('YourDatabaseName');
  • Confirm whether mirroring_witness_name is NULL or mirroring_witness_state_desc shows UNKNOWN.

Step 2: Re-establish the Witness Endpoint Connection

  • Open SQL Server Configuration Manager on the witness server and confirm the Database Mirroring Endpoint is listed and started under SQL Server Network Configuration.
  • Check that the endpoint port (commonly 5022) is not blocked:
  Test-NetConnection -ComputerName WitnessServerName -Port 5022
  • On the principal server, re-add the witness explicitly:
  ALTER DATABASE YourDatabaseName SET WITNESS = 'TCP://WitnessServerFQDN:5022';

Step 3: Validate Service Account Permissions on the Endpoint

  • Ensure the SQL Server service account on principal, mirror, and witness instances has CONNECT permission on the mirroring endpoint:
  GRANT CONNECT ON ENDPOINT::Mirroring TO [DOMAIN\SQLServiceAccount];
  • Check Windows Firewall rules on Windows Server 2025 to confirm inbound/outbound rules allow TCP traffic on the mirroring port between all three servers.

Step 4: Restart the Mirroring Session

  • If the witness still fails to attach, remove and reconfigure the entire mirroring session:
  ALTER DATABASE YourDatabaseName SET PARTNER OFF;
  ALTER DATABASE YourDatabaseName SET WITNESS OFF;
  • Re-establish mirroring from scratch using ALTER DATABASE ... SET PARTNER and SET WITNESS with correct endpoint URLs, then confirm certificates (if using certificate-based authentication) have not expired.

Alternative or Verification Steps

  • After applying the fix, re-run the sys.database_mirroring query from Step 1 and confirm mirroring_witness_state_desc returns CONNECTED.
  • If the issue persists, consider migrating to an Always On Availability Group configuration, as Database Mirroring (including witness roles) is deprecated in favor of AGs with automatic failover in SQL Server 2025.

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

Why This Error Happens

Error 1440 is not actually a failure condition; it is an informational status message logged by SQL Server to confirm that Database Mirroring has been successfully configured and that the server instance is currently operating as the Principal in the mirroring session. This message typically appears during SQL Server service startup, during a manual failover, or immediately after the mirroring endpoint is established. It gets flagged as a “reported symptom” usually because administrators see it in the SQL Server Error Log and mistake a logging entry for a system fault, when in reality no action is required unless accompanied by other blocking errors (such as endpoint timeouts or certificate mismatches).

Step-by-Step Resolution Guide

Step 1: Verify the Message Context in the Error Log

  • Open SQL Server Management Studio (SSMS) and navigate to Management > SQL Server Logs.
  • Confirm that Error 1440 appears alone, without adjacent errors like 1474 (Database Mirroring login attempt failed) or 1443 (mirroring connection timeout).
  • If it stands alone, this confirms normal operational behavior rather than a technical fault.

Step 2: Check the Mirroring Session State

  • Run the following T-SQL query to check the current role and state of the mirroring session:
  • SELECT mirroring_role_desc, mirroring_state_desc FROM sys.database_mirroring WHERE database_id = DB_ID('YourDatabaseName');
  • Ensure the mirroring_state_desc returns SYNCHRONIZED and the mirroring_role_desc correctly shows PRINCIPAL.

Step 3: Validate Endpoint and Firewall Configuration (Windows Server 2025)

  • Since this message often coincides with a service restart, verify the TCP endpoint used for mirroring is active and not blocked by Windows Defender Firewall.
  • Open Windows Defender Firewall with Advanced Security and ensure an inbound rule exists for the specific mirroring port (commonly 5022).
  • Run netstat -ano | findstr 5022 in an elevated Command Prompt to confirm the port is listening and bound to the sqlservr.exe process ID.

Step 4: Suppress Informational Logging (Optional)

  • If the volume of “Error 1440” entries is cluttering the log and causing alert fatigue in monitoring tools (like SCOM or Nagios), update your monitoring threshold.
  • Navigate to your monitoring tool’s alert rules and exclude Event ID 1440 specifically, as it does not represent a state of WARNING or CRITICAL severity.
  • Do not disable SQL Server’s general logging; only filter this specific informational ID at the monitoring layer.

Alternative or Verification Steps

  • To verify the fix (or rather, the status), open the Object Explorer in SSMS, right-click the database, select Properties > Mirroring, and visually confirm the “Server Network Address” is correctly listed with the “Role” set to Principal.
  • If mirroring health is still questioned, run sp_dbmmonitorresults 'YourDatabaseName' to pull historical mirroring status data, which provides a more detailed performance history than the single log entry.

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

Troubleshooting Guide: Error 1441 – Database Mirroring Informational Message

Why This Error Happens

Error 1441 is not a true error but an informational status message logged by SQL Server 2025 whenever a database mirroring session successfully establishes a database in the mirror role. It is triggered automatically as part of the normal mirroring state machine when the mirror server receives the initial redo stream or completes a role synchronization from the principal server. This message commonly appears during initial mirroring setup, after a manual or automatic failover, or when the mirroring endpoint reconnects following a network interruption.

Step-by-Step Resolution Guide

Step 1: Confirm This Is Informational Only

  • Open the SQL Server Error Log via SSMS: Management > SQL Server Logs, or query directly:
  • EXEC sp_readerrorlog 0, 1, 'Database mirroring';
  • Verify the message text explicitly states “This is an informational message only. No user action is required.” — if so, no corrective action is needed for Error 1441 itself.

Step 2: Validate Mirroring Session Health

  • Run the following query on both principal and mirror instances to check synchronization state:
  • SELECT mirroring_state_desc, mirroring_role_desc, mirroring_safety_level_desc FROM sys.database_mirroring WHERE database_id = DB_ID('YourDatabaseName');
  • Confirm mirroring_state_desc returns SYNCHRONIZED (or SYNCHRONIZING if operating in High Performance mode).
  • Check for any unexpected role switches in the Windows Event Viewer under Applications and Services Logs > Microsoft > Windows > SQL Server.

Step 3: Review Endpoint and Network Configuration

  • On both servers, verify the mirroring endpoint is started and listening:
  • SELECT name, state_desc, port FROM sys.database_mirroring_endpoints;
  • Confirm firewall rules on Windows Server 2025 / Windows 11 allow inbound/outbound traffic on the configured mirroring port (default 5022):
  • New-NetFirewallRule -DisplayName "SQL Mirroring" -Direction Inbound -Protocol TCP -LocalPort 5022 -Action Allow
  • Ensure the service account running SQL Server has appropriate CONNECT permissions on the mirroring endpoint via GRANT CONNECT ON ENDPOINT::Mirroring TO [DOMAIN\ServiceAccount];

Step 4: Rule Out Repeated Failover Triggers

  • If Error 1441 appears repeatedly in short intervals, check the Witness server (if configured) for connectivity issues causing automatic failovers.
  • Review sys.dm_db_mirroring_connections for dropped or re-established sessions correlating with the timestamp of each 1441 entry.

Alternative or Verification Steps

  • Run SELECT state_desc FROM sys.database_mirroring_endpoints; on both instances — a STARTED state on both confirms the mirroring channel is healthy and the 1441 message was simply a routine status update.
  • If synchronization issues persist despite the informational log entry, consider removing and re-establishing the mirroring session using ALTER DATABASE [YourDatabaseName] SET PARTNER OFF; followed by reconfiguring mirroring from a fresh full backup and transaction log backup restore sequence.

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

Why This Error Happens

Error 1435 occurs when a database mirroring endpoint receives an unexpected status response, typically because the mirroring session state does not match what the partner server expects (e.g., the principal or mirror was restarted, failed over, or manually altered outside of the mirroring context). This is commonly triggered by network interruptions between endpoints, expired or mismatched certificates used for endpoint authentication, or a witness server that has lost quorum communication with one of the partners. In Windows Server 2025 environments, stricter TLS 1.3 enforcement and updated firewall defaults can also cause endpoint handshake failures that manifest as this status mismatch.

Step-by-Step Resolution Guide

Step 1: Verify Endpoint State and Connectivity

  • Run SELECT * FROM sys.database_mirroring_endpoints; on both principal and mirror instances to confirm the endpoint state_desc is STARTED.
  • Test raw TCP connectivity using Test-NetConnection -ComputerName <PartnerServer> -Port 5022 from PowerShell.
  • Check Windows Defender Firewall rules on both servers to ensure the mirroring port (default 5022) is allowed for both inbound and outbound traffic.

Step 2: Validate Certificates and Authentication

  • Open SQL Server Configuration Manager and confirm the service account has not changed since the endpoint was created.
  • Run SELECT name, expiry_date FROM sys.certificates; to check for expired certificates used in endpoint authentication.
  • If certificates are expired or mismatched, recreate them using CREATE CERTIFICATE and reissue them to both partner instances, then re-run ALTER ENDPOINT to bind the new certificate.

Step 3: Restart the Mirroring Session

  • Pause mirroring using ALTER DATABASE <DBName> SET PARTNER SUSPEND; on the principal.
  • Resume the session with ALTER DATABASE <DBName> SET PARTNER RESUME; once connectivity and certificates are confirmed.
  • Review the SQL Server Error Log (Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for confirmation that the mirroring session has re-established without further 1435 entries.

Step 4: Check Witness Server Health (If Configured)

  • Confirm the witness instance is reachable and its endpoint is also in a STARTED state.
  • Validate that the witness server account has the correct CONNECT permission on the mirroring endpoint using GRANT CONNECT ON ENDPOINT::<EndpointName> TO [DOMAIN\ServiceAccount];.

Alternative or Verification Steps

  • Query sys.dm_db_mirroring_connections on both partners to confirm active, healthy connections with no repeated disconnect/reconnect cycles.
  • If the error persists after certificate and connectivity fixes, drop and recreate the mirroring endpoints entirely using DROP ENDPOINT followed by a fresh CREATE ENDPOINT configuration on both the principal and mirror servers.

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

Troubleshooting Guide: Error 1436 – Service Broker ID Mismatch

Why This Error Happens

This error occurs when the Service Broker GUID stored in the mirror (or secondary) database does not match the Service Broker GUID of the principal database, which typically happens after a database has been restored from an older backup, detached and reattached, or recreated without properly syncing broker metadata. Database Mirroring and Service Broker routing rely on this unique identifier to establish a trusted conversation endpoint between the principal and mirror servers; if the IDs diverge, SQL Server 2025 blocks the mirroring session to prevent message routing conflicts. This commonly surfaces after a failed failover, a manual database copy, or when ALTER DATABASE SET NEW_BROKER was run on one instance but not synchronized with its partner.

Step-by-Step Resolution Guide

Step 1: Verify the Current Service Broker IDs

  • Open SQL Server Management Studio (SSMS) and connect to both the principal and mirror instances.
  • Run the following query on both servers to compare the service_broker_guid:
  SELECT name, service_broker_guid, is_broker_enabled 
  FROM sys.databases 
  WHERE name = 'YourDatabaseName';
  • Confirm the GUIDs are mismatched before proceeding.

Step 2: Remove and Re-establish the Mirroring Session

  • On the principal server, break the existing mirroring partnership:
  ALTER DATABASE [YourDatabaseName] SET PARTNER OFF;
  • On the mirror server, restore a fresh full backup and transaction log backup from the principal using WITH NORECOVERY:
  RESTORE DATABASE [YourDatabaseName] FROM DISK = 'C:\Backups\YourDB_Full.bak' WITH NORECOVERY;
  RESTORE LOG [YourDatabaseName] FROM DISK = 'C:\Backups\YourDB_Log.trn' WITH NORECOVERY;
  • This ensures the mirror inherits the exact Service Broker GUID from the principal copy.

Step 3: Reconfigure the Mirroring Endpoints

  • Verify the TCP endpoints are active on both nodes (default port 5022) via sys.database_mirroring_endpoints.
  • Re-establish the partnership on both servers:
  -- On Mirror:
  ALTER DATABASE [YourDatabaseName] SET PARTNER = 'TCP://PrincipalServer.domain.com:5022';
  -- On Principal:
  ALTER DATABASE [YourDatabaseName] SET PARTNER = 'TCP://MirrorServer.domain.com:5022';
  • If using Windows Server 2025 firewall profiles, ensure the Windows Defender Firewall rule for port 5022 is enabled under “Inbound Rules” for the SQL Server service.

Step 4: Force a New Broker ID If Mirroring Is Not Required

  • If this database does not need Service Broker messaging synced with mirroring, regenerate the broker ID manually on the affected instance:
  ALTER DATABASE [YourDatabaseName] SET NEW_BROKER WITH ROLLBACK IMMEDIATE;
  • Note: This disables existing Service Broker conversations and queues, so only use this if no active broker-dependent applications are running.

Alternative or Verification Steps

  • Confirm resolution by checking the SQL Server Error Log (Management > SQL Server Logs in SSMS) for a successful “Database mirroring is active” message with no further Error 1436 entries.
  • Re-run the sys.databases GUID comparison query from Step 1 on both servers — the service_broker_guid values should now be identical, confirming the sync succeeded.

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

Troubleshooting Guide: SQL Server Error 1437 – Insufficient Memory to Post Message

Why This Error Happens

Error 1437 occurs when SQL Server’s internal messaging subsystem (used for inter-process or inter-instance communication, such as replication or Database Mail) cannot allocate enough memory to post a message to the specified server instance. This is typically caused by SQL Server’s memory configuration being too restrictive, excessive memory pressure from other applications on the host, or memory fragmentation within the SQL Server process itself. On Windows Server 2025 and Windows 11, this can also be triggered by misconfigured Virtualization-Based Security (VBS) or Hyper-V dynamic memory settings that artificially cap available memory.

Step-by-Step Resolution Guide

Step 1: Verify Current SQL Server Memory Configuration

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run the following query to check current min/max memory settings:
  • EXEC sp_configure 'show advanced options', 1; RECONFIGURE; EXEC sp_configure 'max server memory';
  • Confirm the “max server memory (MB)” value isn’t set too low relative to total system RAM.

Step 2: Increase Max Server Memory Allocation

  • Calculate an appropriate value, leaving at least 2–4 GB for the OS on systems with 16GB+ RAM.
  • Execute: EXEC sp_configure 'max server memory', 8192; RECONFIGURE; (adjust value in MB as needed).
  • Restart the SQL Server service via Services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 3: Check for System-Level Memory Pressure

  • Open Task Manager or Performance Monitor (perfmon.exe) and review the “Memory” tab for available RAM.
  • Identify and close non-essential processes or services consuming excessive memory.
  • On Windows Server 2025, check Hyper-V Manager if running as a VM—ensure Dynamic Memory isn’t throttling the guest OS below required thresholds.

Step 4: Review SQL Server Error Log and Windows Event Viewer

  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Search for related memory warnings (e.g., “Failed Virtual Allocate Bytes” or “Low Memory Condition”).
  • Cross-reference with Windows Event Viewer under Windows Logs > System for OS-level memory warnings.

Step 5: Disable Unnecessary Memory-Intensive Features

  • If Database Mail, Service Broker, or Replication triggered the error, verify their individual memory footprints.
  • Run: EXEC sp_configure 'Database Mail XPs', 0; RECONFIGURE; if Database Mail is not actively required.
  • Consider disabling Lock Pages in Memory policy conflicts via secpol.msc if large page allocations are misconfigured.

Alternative or Verification Steps

  • After applying changes, run DBCC MEMORYSTATUS in SSMS to confirm memory allocation is stable and no longer flagged as critical.
  • If the error persists, check for a pending Windows Update or SQL Server Cumulative Update (CU) that addresses known memory leak issues in the messaging subsystem, and apply it via Windows Update or the SQL Server Installation Center.

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

Troubleshooting Guide: SQL Server Error 1438 — Configuration Request Rejected

Why This Error Happens

Error 1438 occurs when the SQL Server Database Engine rejects a dynamic configuration change, typically because the requested value conflicts with system resource limits, a dependent service lock, or an invalid combination of sp_configure settings. This often happens when changing min server memory, max server memory, or affinity mask settings while the instance lacks the required permissions or encounters a locked configuration file. In some cases, the SQL Server service account does not have sufficient rights over the registry or data directories, causing the engine to reject the reconfigure operation silently until the error log is checked.

Step-by-Step Resolution Guide

Step 1: Review the SQL Server Error Log for the Specific Reason Code

  • Open SQL Server Management Studio (SSMS) and navigate to Management > SQL Server Logs.
  • Alternatively, locate the physical log file at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Search for the line containing “rejected configure request” and note the numeric reason code (%u) immediately following it — this determines whether the issue is memory, affinity, or permission-related.

Step 2: Verify Service Account Permissions

  • Open Services.msc and confirm the account running the SQL Server (MSSQLSERVER) service.
  • Ensure this account has Full Control on the data directory, typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA.
  • Verify the account also has the “Lock Pages in Memory” and “Perform Volume Maintenance Tasks” rights via secpol.msc > Local Policies > User Rights Assignment.

Step 3: Correct Conflicting sp_configure Values

  • Run the following to inspect current configuration state:
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure;
  • Check for illogical values, such as min server memory being set higher than max server memory.
  • Reset the conflicting value, for example:
EXEC sp_configure 'max server memory', 8192;
RECONFIGURE WITH OVERRIDE;

Step 4: Restart the SQL Server Service Cleanly

  • Open PowerShell as Administrator and run:
Restart-Service -Name 'MSSQLSERVER' -Force
  • Confirm the service transitions fully to “Running” state before attempting further configuration changes.
  • Re-check the ERRORLOG file to ensure no further rejection messages appear on startup.

Step 5: Validate Windows Server 2025 Resource Governor Settings

  • If running under Hyper-V or a constrained resource pool, confirm that Windows Server 2025’s Resource Governor isn’t capping memory below SQL Server’s configured minimum.
  • Adjust virtual machine or container memory allocation in Hyper-V Manager > Settings > Memory to align with SQL Server’s min server memory value.

Alternative or Verification Steps

  • After applying changes, run EXEC sp_configure; again and confirm the “runvalue” matches the intended “configvalue” with no pending restart required.
  • If the error persists, start SQL Server in minimal configuration mode using sqlservr.exe -f from an elevated Command Prompt to reset all configuration values to defaults, then reapply settings incrementally.

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

Troubleshooting Guide: SQL Server Error 1433 — Database Mirroring Witness Connectivity Failure

Why This Error Happens

This error occurs when the Principal, Mirror, and Witness server instances fail to maintain a stable network connection to one another while the ALTER DATABASE SET WITNESS command is executing, often due to transient network latency or firewall interruptions on the endpoint ports. It can also be caused by the Database Mirroring endpoints not being fully started or authenticated on all three instances, or by a certificate/login mismatch preventing the Witness server from establishing a quorum with the other two partners. Additionally, Windows Server 2025 security policies may block the specific TCP port used for mirroring, causing the session to drop before the configuration change is fully committed.

Step-by-Step Resolution Guide

Step 1: Verify Endpoint Status on All Three Instances

  • Connect to the Principal, Mirror, and Witness instances individually using SSMS or sqlcmd.
  • Run the following query on each instance to ensure the endpoint state is STARTED:
  SELECT name, state_desc, port FROM sys.tcp_endpoints;
  • If the state shows STOPPED, restart it manually:
  ALTER ENDPOINT [Mirroring] STATE = STARTED;

Step 2: Check Windows Firewall and Network Connectivity

  • Ensure the specific mirroring port (commonly 5022 or a custom port) is open for inbound and outbound traffic on all three Windows Server 2025 / Windows 11 machines.
  • Use PowerShell to open the port if necessary:
  New-NetFirewallRule -DisplayName "SQL Mirroring" -Direction Inbound -LocalPort 5022 -Protocol TCP -Action Allow
  • Test raw connectivity between servers using Test-NetConnection -ComputerName <ServerName> -Port 5022 to rule out network drops.

Step 3: Validate Login Permissions and Certificates

  • Confirm that the SQL Server service accounts for all three instances have CONNECT permissions on the respective mirroring endpoints.
  • If using certificate-based authentication (common in non-domain setups), verify the certificates haven’t expired and are correctly mapped to logins on each server.
  • Re-grant connect permissions if needed:
  GRANT CONNECT ON ENDPOINT::[Mirroring] TO [Domain\ServiceAccount];

Step 4: Re-run the SET WITNESS Command

  • Once connectivity, firewall rules, and permissions are confirmed, return to the Principal server and re-issue the command.
  • Execute the following, replacing the path with your specific Witness server address:
  ALTER DATABASE [YourDatabaseName] SET WITNESS = 'TCP://WitnessServer.domain.com:5022';
  • Monitor the SQL Server Error Log immediately after execution for a confirmation message that the witness was added successfully.

Alternative or Verification Steps

  • To verify the fix, query the mirroring status using SELECT * FROM sys.database_mirroring WHERE mirroring_witness_state_desc = 'CONNECTED';. If this returns a result, the Witness is successfully attached.
  • If the error persists after retrying, remove the witness entirely (ALTER DATABASE... SET WITNESS OFF), restart the SQL Server service on the Witness node specifically, and attempt to add the witness again during a period of lower network traffic.

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

Troubleshooting Guide: SQL Server Error 1434 — Invalid Database Mirroring Message

Why This Error Happens

This error occurs when the database mirroring endpoint receives a malformed or unexpected message type, typically caused by a version mismatch between the principal and mirror server instances, or by network-level packet corruption/fragmentation during transmission. It can also result from mismatched encryption algorithms configured on the mirroring endpoints (one server using AES while the other expects RC4, or no encryption at all), or from a partner server that was abruptly restarted mid-transaction, leaving the endpoint in an inconsistent state. In rarer cases, this stems from a firewall or load balancer silently altering TCP packets on the mirroring port (default 5022), introducing corruption that SQL Server interprets as an invalid message structure.

Step-by-Step Resolution Guide

Step 1: Verify Mirroring Endpoint Configuration Matches on Both Servers

  • Run SELECT * FROM sys.database_mirroring_endpoints; on both the principal and mirror instances.
  • Confirm the encryption_algorithm column matches exactly on both servers (e.g., both set to AES or both set to NONE).
  • If mismatched, run ALTER ENDPOINT [Mirroring] FOR DATABASE_MIRRORING (ENCRYPTION = REQUIRED ALGORITHM AES); on the inconsistent instance.

Step 2: Check for SQL Server Version and Patch Mismatch

  • Confirm both instances are running identical SQL Server 2025 build numbers via SELECT @@VERSION;.
  • Apply any pending Cumulative Updates (CU) so both principal and mirror share the same patch level.
  • Restart the SQL Server service after patching: Restart-Service -Name 'MSSQLSERVER' in PowerShell (run as Administrator).

Step 3: Inspect Firewall and Network Path for Port 5022

  • Open Windows Defender Firewall with Advanced Security and verify an inbound/outbound rule exists for TCP port 5022 (or your custom mirroring port).
  • Run Test-NetConnection -ComputerName <PartnerServerName> -Port 5022 from PowerShell on each server to confirm connectivity.
  • Disable any intermediary packet inspection, deep packet inspection (DPI), or SSL offloading on network appliances between the two servers, as these can corrupt mirroring traffic.

Step 4: Rebuild the Mirroring Session

  • On the mirror server, run ALTER DATABASE [YourDB] SET PARTNER OFF; to break the existing mirroring session.
  • On the principal, take a fresh full backup and transaction log backup, then restore both on the mirror server using WITH NORECOVERY.
  • Re-establish mirroring using ALTER DATABASE [YourDB] SET PARTNER = 'TCP://<PrincipalServer>:5022'; on the mirror, then repeat with the mirror’s address on the principal.

Step 5: Review SQL Server Error Logs and Extended Events

  • Open SQL Server Management Studio (SSMS) and navigate to Management > SQL Server Logs.
  • Cross-reference the exact timestamp of Error 1434 with Windows Event Viewer (Event ID 1434 under Application logs) to identify if the issue correlates with a specific network event or service restart.

Alternative or Verification Steps

  • After completing the steps above, monitor sys.database_mirroring state using SELECT mirroring_state_desc FROM sys.database_mirroring WHERE database_id = DB_ID('YourDB'); — it should return SYNCHRONIZED.
  • If the error persists, consider migrating to Always On Availability Groups instead of legacy database mirroring, as mirroring is deprecated and AGs offer more robust error handling and diagnostics in SQL Server 2025.

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

Troubleshooting Guide: Error 1430 – “Database Is in an Unstable State for Removing Database Mirroring”

Why This Error Happens

This error typically occurs when SQL Server detects that the mirrored database is in the middle of a state transition—such as a failover, role switch, or synchronization process—when the ALTER DATABASE SET PARTNER OFF command is issued. It can also arise if the mirroring endpoint is unresponsive, the database is still flaged as “Synchronizing” or “Suspended,” or there is a transient communication breakdown between the principal and mirror instances. Essentially, SQL Server refuses to remove mirroring because doing so at that exact moment could risk data consistency or leave the database in an undefined state.

Step-by-Step Resolution Guide

Step 1: Verify Current Mirroring State

  • Run the following query to inspect the mirroring status before attempting removal:
SELECT database_id, mirroring_state_desc, mirroring_role_desc, mirroring_safety_level_desc
FROM sys.database_mirroring
WHERE database_id = DB_ID('YourDatabaseName');
  • Confirm the mirroring_state_desc is SYNCHRONIZED and not SUSPENDED, PENDING_FAILOVER, or DISCONNECTED.
  • If the state is unstable, wait a few minutes and re-check, as SQL Server may self-resolve transient network blips.

Step 2: Check Endpoint and Network Connectivity

  • Open SQL Server Configuration Manager and confirm the TCP/IP protocol is enabled for the instance under SQL Server Network Configuration.
  • Validate the mirroring endpoint is listening by running:
SELECT name, state_desc, port FROM sys.tcp_endpoints;
  • Use Test-NetConnection -ComputerName <PartnerServer> -Port <MirroringPort> in PowerShell to confirm there is no firewall block between principal and mirror on Windows Server 2025.

Step 3: Resume or Pause Mirroring Before Removal

  • If the database shows SUSPENDED, resume mirroring first:
ALTER DATABASE YourDatabaseName SET PARTNER RESUME;
  • Allow the database to fully synchronize (verify via sys.database_mirroring again) before attempting to break the mirror.
  • Once SYNCHRONIZED, execute the removal command from the principal server:
ALTER DATABASE YourDatabaseName SET PARTNER OFF;

Step 4: Restart the Mirroring Endpoint (If Still Stuck)

  • If the error persists, restart the database mirroring endpoint to clear any stuck internal state:
ALTER ENDPOINT Mirroring_Endpoint STATE = STOPPED;
ALTER ENDPOINT Mirroring_Endpoint STATE = STARTED;
  • Re-attempt the SET PARTNER OFF command after the endpoint restarts cleanly.

Step 5: Restart SQL Server Service as a Last Resort

  • On Windows Server 2025, open Services.msc, locate SQL Server (MSSQLSERVER), and restart the service during a maintenance window.
  • This clears any orphaned mirroring session threads holding the database in a transitional lock state.

Alternative or Verification Steps

  • After applying the fix, re-run SELECT mirroring_state_desc FROM sys.database_mirroring WHERE database_id = DB_ID('YourDatabaseName'); and confirm the result returns NULL (indicating mirroring has been successfully removed).
  • If removal still fails, consider using ALTER DATABASE YourDatabaseName SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS on the mirror (only in disaster recovery scenarios) to forcibly break the mirroring relationship, accepting potential data loss.

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

Troubleshooting Guide: SQL Server Error 1431 (Partner/Witness Instance Unavailable)

Why This Error Happens

Error 1431 occurs when the database mirroring session cannot establish a TCP connection to either the partner (mirror) or witness server instance, typically due to the endpoint being offline, stopped, or unreachable over the network. This is commonly caused by a SQL Server service outage on the partner/witness, a Windows Firewall rule blocking the mirroring endpoint port, or an invalid/expired certificate used for endpoint authentication. In some cases, DNS resolution failures or incorrect endpoint URLs (TCP://hostname:port) configured in the ALTER DATABASE SET PARTNER statement also trigger this failure.

Step-by-Step Resolution Guide

Step 1: Verify Service and Endpoint Status on All Instances

  • Confirm the SQL Server service is running on both the principal, mirror, and witness instances via services.msc or Get-Service MSSQLSERVER.
  • Run SELECT * FROM sys.database_mirroring_endpoints; on each instance to confirm the endpoint state_desc is STARTED.
  • If stopped, restart it manually: ALTER ENDPOINT [Mirroring] STATE = STARTED;

Step 2: Check Network Connectivity and Firewall Rules

  • From the principal server, test connectivity to the partner/witness port (default 5022) using Test-NetConnection -ComputerName <PartnerHost> -Port 5022.
  • On Windows Server 2025 / Windows 11, open Windows Defender Firewall with Advanced Security and ensure an inbound rule exists allowing TCP traffic on the mirroring endpoint port for sqlservr.exe.
  • If using a cloud or segmented network, verify NSG/VLAN rules aren’t silently dropping the port.

Step 3: Validate Endpoint Certificates and Authentication

  • Run SELECT name, certificate_id FROM sys.database_mirroring_endpoints; to confirm each instance has a valid certificate bound (if using certificate-based authentication instead of Windows Authentication/Kerberos).
  • Check certificate expiration with SELECT name, expiry_date FROM sys.certificates; — expired certs are a leading cause of silent mirroring failures.
  • If expired, create and re-exchange new certificates between principal, mirror, and witness, then re-run the CREATE ENDPOINT / ALTER ENDPOINT statements with the updated certificate.

Step 4: Re-Verify the Partner and Witness URLs

  • Re-check the exact syntax used: ALTER DATABASE [YourDB] SET WITNESS = 'TCP://WitnessServer.domain.com:5022';
  • Ensure hostnames resolve correctly via nslookup or Resolve-DnsName, especially in mixed Windows Server 2025 / Windows 11 domain environments where DNS suffix search order may differ.
  • Correct any typos, stale IPs, or outdated FQDNs in the mirroring configuration.

Step 5: Restart the Mirroring Session

  • Once connectivity, certificates, and endpoints are confirmed healthy, reissue the failed command (e.g., ALTER DATABASE SET PARTNER or SET WITNESS).
  • Monitor the SQL Server error log and Windows Event Viewer (Application log) for confirmation that the mirroring session re-established.

Alternative or Verification Steps

  • Run SELECT mirroring_state_desc, mirroring_role_desc FROM sys.database_mirroring WHERE database_id = DB_ID('YourDB'); on the principal — a healthy session should show SYNCHRONIZED.
  • If the issue persists after all steps, temporarily remove the witness server from the configuration (ALTER DATABASE SET WITNESS OFF) to confirm whether the witness specifically is the failure point, then re-add it once its connectivity/certificate issues are resolved.

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

Troubleshooting Guide: SQL Server Error 1432 – Database Mirroring Page Repair Request

Why This Error Happens

This error occurs when SQL Server detects a corrupted or unreadable physical page in a mirrored database and automatically attempts to self-heal by requesting a clean copy of that page from the mirroring partner. The root cause is typically underlying storage corruption caused by faulty disk hardware, a failing RAID controller, or an improperly shut down volume on the Windows Server 2025 host. While Error 1432 itself is informational (indicating the automatic page repair process has started), it signals that something is actively damaging data pages at the I/O subsystem level.

Step-by-Step Resolution Guide

Step 1: Confirm the Page Repair Outcome

  • Check the SQL Server Error Log and Windows Event Viewer (Application Log) for a follow-up message, either Error 1433 (repair succeeded) or Error 1479/3414 (repair failed).
  • Run the following query to inspect the repair history:
SELECT * FROM msdb.dbo.suspect_pages;
  • If event_type = 5, the page was successfully repaired and no further action is needed.

Step 2: Run DBCC CHECKDB to Assess Full Database Integrity

  • Open SQL Server Management Studio (SSMS) or a terminal with sqlcmd on the Principal server.
  • Execute a full consistency check to rule out additional corruption beyond the single flagged page:
DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for allocation or consistency errors that may require REPAIR_ALLOW_DATA_LOSS (only as a last resort on a non-mirrored copy).

Step 3: Inspect the Underlying Storage Subsystem

  • Navigate to Windows Server Manager > Tools > Event Viewer > Windows Logs > System, and filter for Disk, Ntfs, or iScsiPrt source warnings/errors.
  • On Windows Server 2025, run Get-PhysicalDisk | Get-StorageReliabilityCounter in PowerShell to check for read/write error counts on the drive hosting the .mdf/.ldf files.
  • If using virtualized storage, verify the underlying SAN/NAS or vDisk health through the hypervisor management console (e.g., Hyper-V Manager or VMware vCenter).

Step 4: Validate the Mirroring Endpoint and Network Health

  • Confirm the mirroring endpoint is healthy by checking sys.database_mirroring_endpoints on both Principal and Mirror instances.
  • Ensure no firewall rules on Windows Server 2025 (Windows Defender Firewall with Advanced Security) are intermittently blocking the mirroring port (default 5022), which can delay page-repair data transfer.
  • Verify the mirroring session state using:
SELECT mirroring_state_desc, mirroring_safety_level_desc FROM sys.database_mirroring;

Step 5: Patch and Update SQL Server 2025

  • Apply the latest Cumulative Update (CU) for SQL Server 2025 via Microsoft Update or the SQL Server Installation Center, as page-repair logic and storage I/O handling are frequently refined in servicing releases.
  • Restart the SQL Server service (net stop MSSQLSERVER / net start MSSQLSERVER) after patching to ensure the update takes effect.

Alternative or Verification Steps

  • Verify the fix by re-running DBCC CHECKDB on the affected database and confirming zero allocation/consistency errors, and query msdb.dbo.suspect_pages to ensure no new rows are added over a 24-48 hour monitoring window.
  • If automatic page repair continues to fail repeatedly, consider failing over to the Mirror server (ALTER DATABASE YourDatabaseName SET PARTNER FAILOVER) and performing a full disk/hardware diagnostic on the original Principal server before failing back.

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

Troubleshooting Guide: SQL Server Error 1428 – “Request Refused, Instance Not in a State to Service the Request”

Why This Error Happens

This error typically occurs when a SQL Server 2025 instance is in a transitional or restricted state—such as during database mirroring/Always On Availability Group role changes, while the instance is starting up, shutting down, or recovering from a failover. It can also surface when the target instance is in single-user mode, is paused for maintenance, or has exceeded its configured connection limits during a state transition. In some cases, stale endpoint configurations or certificate mismatches on the mirroring/AG endpoint prevent the instance from accepting new session requests even though the service itself is running.

Step-by-Step Resolution Guide

Step 1: Verify the Current State of the SQL Server Instance

  • Open SQL Server Management Studio (SSMS) and connect to the instance using a DAC (Dedicated Administrator Connection) if a normal connection is refused: sqlcmd -S servername -A
  • Run SELECT state_desc, role_desc FROM sys.availability_replicas ar JOIN sys.dm_hadr_availability_replica_states rs ON ar.replica_id = rs.replica_id; to check Availability Group replica state.
  • Check Windows Event Viewer under Applications and Services Logs > MSSQLSERVER for recent state-change messages (startup, failover, or recovery events).

Step 2: Restart the SQL Server Service Cleanly

  • Open SQL Server Configuration Manager (search SQLServerManager17.msc on Windows Server 2025/Windows 11).
  • Right-click the instance (e.g., MSSQLSERVER) and select Restart to force a clean state reset.
  • Alternatively, use PowerShell: Restart-Service -Name 'MSSQLSERVER' -Force
  • Monitor the SQL Server error log at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for successful recovery completion messages.

Step 3: Check and Reconfigure Database Mirroring/Always On Endpoints

  • Verify the endpoint is started: SELECT name, state_desc FROM sys.database_mirroring_endpoints;
  • If the state is STOPPED, restart it with: ALTER ENDPOINT [Hadr_endpoint] STATE = STARTED;
  • Confirm the endpoint port (default 5022) isn’t blocked by Windows Defender Firewall: New-NetFirewallRule -DisplayName "SQL AG Endpoint" -Direction Inbound -Protocol TCP -LocalPort 5022 -Action Allow

Step 4: Validate Connection and Resource Limits

  • Check if the instance is in single-user mode unintentionally: SELECT name, user_access_desc FROM sys.databases WHERE name = 'master';
  • If stuck in single-user mode, reset it: ALTER DATABASE [YourDB] SET MULTI_USER;
  • Review max worker threads and connection pool settings in SQL Server Properties > Advanced to ensure the instance isn’t throttled.

Step 5: Apply the Latest Cumulative Update

  • Confirm your current build number: SELECT @@VERSION;
  • Download and install the latest Cumulative Update (CU) for SQL Server 2025 from the Microsoft Update Catalog to resolve any known state-transition bugs.
  • Reboot Windows Server 2025 after installation to fully apply servicing changes.

Alternative or Verification Steps

  • After restarting services, test connectivity using sqlcmd -S servername -E -Q "SELECT GETDATE();" — a successful timestamp return confirms the instance is servicing requests normally.
  • If the issue persists only during failover events, consider switching the Availability Group to Manual Failover mode temporarily and manually validate each replica’s health via sys.dm_hadr_availability_replica_states before re-enabling automatic failover.

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

Troubleshooting Guide: Error 1429 – Witness Server Instance Must Be Distinct

Why This Error Happens

This error occurs when configuring Database Mirroring and the instance name specified for the Witness server matches either the Principal or Mirror instance name, including cases where the same physical server is used with identical instance names across different ports. SQL Server 2025 enforces strict uniqueness checks on the NetworkAddress and instance identifiers in the ALTER DATABASE SET WITNESS command to prevent endpoint collisions. This typically happens when administrators clone VM images for lab environments or mistakenly point the witness connection string to the same TCP endpoint already used by the Principal/Mirror pair.

Step-by-Step Resolution Guide

Step 1: Verify the Endpoint Configuration of All Three Instances

  • Run SELECT * FROM sys.database_mirroring_endpoints; on the Principal, Mirror, and Witness instances individually.
  • Confirm that each instance has a unique @@SERVERNAME and a distinct TCP port (standard practice is 5022 for Principal/Mirror and 5023 for Witness).
  • Check Windows Server 2025 Firewall rules via Windows Defender Firewall with Advanced Security to ensure the Witness port isn’t being redirected to the same NIC binding as the Mirror.

Step 2: Correct the ALTER DATABASE Syntax

  • Re-issue the command on the Principal server using the fully qualified domain name (FQDN) or distinct IP literal for the Witness, rather than reusing a localhost or shared hostname alias.
  • Example corrected syntax:
  ALTER DATABASE [YourDB] 
  SET WITNESS = 'TCP://WitnessServerFQDN:5023';
  • Avoid using the same NetBIOS name for the Witness if it was cloned from the Mirror server image without running sysprep.

Step 3: Audit SQL Server Instance Identity (For Cloned VMs)

  • If running on Windows Server 2025 Hyper-V clusters, check if the VMs were cloned without generating a new machine SID.
  • Navigate to SQL Server Configuration Manager > SQL Server Network Configuration to verify the instance alias isn’t duplicated across the Mirror and Witness nodes.
  • Rename the instance using sp_dropserver and sp_addserver 'NewUniqueName', 'local' followed by a service restart if a naming collision is confirmed.

Step 4: Restart the Database Mirroring Session

  • Drop the existing broken session using ALTER DATABASE [YourDB] SET PARTNER OFF;.
  • Re-establish the mirroring topology starting with the Principal, then the Mirror, and finally attach the Witness using the corrected, unique network address.

Alternative or Verification Steps

  • Verification: Check the SQL Server Error Log immediately after the ALTER DATABASE command; a successful configuration will log “Database mirroring has been enabled” rather than Error 1429.
  • Alternative: If the Witness continually resolves to the wrong IP due to DNS caching on Windows Server 2025, bypass DNS entirely by using a static IP address in the connection string instead of the FQDN.

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

Troubleshooting Guide: Error 1425 – “The property value is invalid for ‘%.*ls’. Property value not changed.”

Why This Error Happens

This error typically occurs when SQL Server 2025 rejects a property modification because the supplied value falls outside the acceptable range, type, or format expected for that specific object property (e.g., database, server, or extended property settings). It is commonly triggered by mismatched data types, invalid characters in a property name/value, or attempting to set a property on an object that has restrictions due to permissions or compatibility level. In some cases, this also surfaces when SSMS (SQL Server Management Studio) or a management API passes a malformed value due to a corrupted configuration cache or an outdated client tool interacting with Windows Server 2025 security policies.

Step-by-Step Resolution Guide

Step 1: Identify the Exact Property and Object Causing the Error

  • Check the SQL Server error log located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for the full error context.
  • Run the following query to pinpoint recent property change attempts:
  SELECT * FROM sys.extended_properties;
  • Note the exact property name referenced in the %.*ls placeholder from the error message.

Step 2: Validate the Property Value Format and Data Type

  • Ensure the value does not exceed length limits (most extended properties cap at 7,500 bytes).
  • Confirm there are no invalid characters (e.g., unescaped quotes, null bytes, or Unicode control characters) in the value string.
  • If modifying via T-SQL, test with sp_updateextendedproperty using a simplified ASCII value first:
  EXEC sp_updateextendedproperty 
       @name = N'MS_Description', 
       @value = N'TestValue', 
       @level0type = N'SCHEMA', @level0name = N'dbo', 
       @level1type = N'TABLE', @level1name = N'YourTable';

Step 3: Check Permissions and Compatibility Level

  • Verify the executing account has ALTER permission on the target object and is not blocked by Windows Server 2025 Group Policy restrictions on service accounts.
  • Confirm the database compatibility level supports the property being set:
  SELECT compatibility_level FROM sys.databases WHERE name = 'YourDatabaseName';
  • If outdated, update it:
  ALTER DATABASE YourDatabaseName SET COMPATIBILITY_LEVEL = 170;

Step 4: Clear Cached Configuration and Restart Services

  • Close SQL Server Management Studio completely and clear the cache folder:
    %AppData%\Microsoft\SQL Server Management Studio\<version>\Cache
  • Restart the SQL Server (MSSQLSERVER) service via services.msc or PowerShell:
  Restart-Service -Name 'MSSQLSERVER' -Force
  • Reattempt the property change through a fresh SSMS session.

Step 5: Reapply the Property Using a Script Instead of the GUI

  • If the error originated from the SSMS GUI (e.g., Database Properties window), bypass it by using a T-SQL script instead, as the GUI sometimes passes malformed hidden values.
  • Re-run the corrected sp_addextendedproperty or sp_updateextendedproperty command directly in a Query window.

Alternative or Verification Steps

  • Verify the fix by querying sys.extended_properties or sys.server_properties again to confirm the new value persisted correctly without reverting.
  • If the issue persists, use sp_dropextendedproperty to remove the corrupted property entirely, then recreate it fresh using sp_addextendedproperty with validated values.

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

Troubleshooting Guide: Error 1426 on ALTER DATABASE SET WITNESS (SQL Server 2025)

Why This Error Happens

Error 1426 occurs when SQL Server cannot establish a mirroring endpoint connection to the witness server, typically because the database mirroring endpoint is not configured, started, or reachable over the network. This is commonly caused by a firewall blocking the mirroring port (default 5022), mismatched endpoint authentication/encryption settings between the principal, mirror, and witness instances, or the SQL Server service account lacking CONNECT permission on the endpoint. It can also result from an incorrect witness server name/port specified in the ALTER DATABASE statement.

Step-by-Step Resolution Guide

Step 1: Verify the Database Mirroring Endpoint Exists and Is Started

  • Run the following query on all three instances (principal, mirror, witness):
  • SELECT name, type_desc, state_desc, port FROM sys.tcp_endpoints;
  • Confirm state_desc shows STARTED and the port matches (default 5022).
  • If missing, create it with:
  • CREATE ENDPOINT Mirroring STATE=STARTED AS TCP (LISTENER_PORT=5022) FOR DATABASE_MIRRORING (ROLE=WITNESS);

Step 2: Check Windows Firewall Rules on Windows Server 2025 / Windows 11

  • Open Windows Defender Firewall with Advanced Security.
  • Create an inbound rule allowing TCP traffic on port 5022 for the SQL Server service.
  • Use PowerShell for a quick fix:
  • New-NetFirewallRule -DisplayName "SQL Mirroring" -Direction Inbound -Protocol TCP -LocalPort 5022 -Action Allow
  • Ensure this rule is applied identically on the principal, mirror, and witness servers.

Step 3: Validate Endpoint Permissions and Authentication

  • Confirm the SQL Server service account (or domain login used) has CONNECT permission:
  • GRANT CONNECT ON ENDPOINT::Mirroring TO [DOMAIN\SQLServiceAccount];
  • Check that all three endpoints use matching AUTHENTICATION (e.g., WINDOWS NEGOTIATE) and ENCRYPTION (e.g., REQUIRED ALGORITHM AES) settings via:
  • SELECT * FROM sys.database_mirroring_endpoints;

Step 4: Re-run the ALTER DATABASE Command with Correct Witness Syntax

  • Confirm the witness server name and port are correct in the TCP address:
  • ALTER DATABASE [YourDB] SET WITNESS = 'TCP://WitnessServerFQDN:5022';
  • Use the fully qualified domain name (FQDN) instead of NetBIOS name to avoid DNS resolution issues.

Alternative or Verification Steps

  • After applying fixes, check the SQL Server Error Log and sys.database_mirroring DMV on the principal to confirm witness_state_desc shows CONNECTED.
  • If the issue persists, test raw connectivity using Test-NetConnection -ComputerName WitnessServerFQDN -Port 5022 from PowerShell to rule out network-layer blocking (VPN, NSG rules, or antivirus interference).

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

Troubleshooting Guide: Error 1427 — Server Instance Could Not Act as Witness

Why This Error Happens

Error 1427 occurs when the principal or mirror server cannot establish a valid endpoint connection to the witness server instance during a Database Mirroring ALTER DATABASE SET WITNESS operation. This is typically caused by the witness server’s database mirroring endpoint being offline, misconfigured, or blocked by a firewall, as well as mismatched service account permissions that prevent the endpoint login from authenticating. Certificate or encryption algorithm mismatches between the mirroring endpoints on the principal, mirror, and witness instances can also trigger this failure.

Step-by-Step Resolution Guide

Step 1: Verify the Database Mirroring Endpoint Exists and Is Started

  • On the witness instance, run SELECT * FROM sys.database_mirroring_endpoints; in SQL Server Management Studio (SSMS) to confirm the endpoint exists.
  • Check the state_desc column; if it reads STOPPED, start it using ALTER ENDPOINT <EndpointName> STATE = STARTED;.
  • If no endpoint exists, create one with CREATE ENDPOINT Endpoint_Mirroring STATE = STARTED AS TCP (LISTENER_PORT = 5022) FOR DATABASE_MIRRORING (ROLE = WITNESS);.

Step 2: Check Windows Firewall and Network Connectivity

  • On Windows Server 2025 / Windows 11, open Windows Defender Firewall with Advanced Security and confirm an inbound rule exists for the mirroring port (default 5022/TCP).
  • Test connectivity from the principal server using Test-NetConnection -ComputerName <WitnessServerName> -Port 5022 in PowerShell.
  • If blocked, create a new inbound rule: New-NetFirewallRule -DisplayName "SQL Mirroring" -Direction Inbound -Protocol TCP -LocalPort 5022 -Action Allow.

Step 3: Validate Login Permissions on the Endpoint

  • Confirm the SQL Server service account (or domain login used for mirroring) has CONNECT permission on the endpoint by running GRANT CONNECT ON ENDPOINT::Endpoint_Mirroring TO [DOMAIN\ServiceAccount]; on all three instances (principal, mirror, witness).
  • If using certificates instead of Windows Authentication, verify the certificates are correctly exchanged and not expired via SELECT * FROM sys.certificates;.

Step 4: Re-run the ALTER DATABASE SET WITNESS Command

  • Execute the command again from the principal server: ALTER DATABASE <DatabaseName> SET WITNESS = 'TCP://<WitnessServerName>:5022';.
  • Monitor the SQL Server Error Log (located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG by default) for any new related error entries during execution.

Alternative or Verification Steps

  • Verify success by querying SELECT mirroring_witness_state_desc FROM sys.database_mirroring WHERE database_id = DB_ID('<DatabaseName>'); — it should return CONNECTED.
  • If the issue persists, drop and recreate the mirroring endpoint entirely on the witness instance, then reconfigure the Service Principal Name (SPN) using setspn -A MSSQLSvc/<WitnessServerName>:5022 <DOMAIN\ServiceAccount> to rule out Kerberos authentication failures.

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

Troubleshooting Guide: SQL Server Error 1422 – Mirror Server Not Caught Up

Why This Error Happens

This error occurs when the database mirroring session is operating in High Performance (Asynchronous) mode, or when a high volume of transactions combined with network latency causes the mirror database to fall behind the principal. Since SQL Server refuses to failover until the mirror has replayed all transaction log records from the principal (to prevent data loss), a lagging redo queue or a broken/slow network link between the principal and mirror instances directly triggers this failure. Additionally, insufficient I/O throughput on the mirror server can prevent the redo thread from keeping pace with the log generation rate on the principal.

Step-by-Step Resolution Guide

Step 1: Verify the Mirroring Operating Mode

  • Open SQL Server Management Studio (SSMS) and connect to the Principal server instance.
  • Run the following query to check the mirroring_safety_level:
  SELECT database_id, mirroring_state_desc, mirroring_safety_level_desc 
  FROM sys.database_mirroring;
  • If the result shows ASYNCHRONOUS, manual failover will always risk this error; you must use the FORCE_SERVICE_ALLOW_DATA_LOSS option instead of a standard failover.

Step 2: Check the Redo Queue and Network Latency

  • On the Mirror server, check Windows Performance Monitor (PerfMon) and add the counter: SQLServer:Database Mirroring > Redo Queue KB.
  • If this number is high and not decreasing, verify network connectivity using ping or psping between the Principal and Mirror IP addresses to rule out packet loss.
  • Check the SQL Server Error Log located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for “Timeout waiting for mirror to acknowledge” messages.

Step 3: Pause Transactional Load and Allow Catch-Up

  • Temporarily pause heavy ETL jobs, index rebuilds, or bulk inserts on the Principal server to allow the mirror’s redo thread to catch up.
  • Monitor the gap using:
  SELECT mirroring_role_desc, mirroring_state_desc, 
  log_send_queue_size, redo_queue_size 
  FROM sys.dm_db_mirroring_connections;
  • Wait until redo_queue_size reaches 0 before attempting the ALTER DATABASE... SET PARTNER FAILOVER command again.

Step 4: Increase Hardware Resources for Redo Thread

  • If the issue persists due to I/O bottlenecks, move the mirror database’s transaction log file to a faster storage tier (e.g., NVMe SSD) via ALTER DATABASE MODIFY FILE.
  • Ensure the Mirror server instance has adequate CPU allocation in Windows Server 2025 Hyper-V settings, as redo operations are single-threaded per database and CPU-speed dependent.

Alternative or Verification Steps

  • Verification: After the catch-up period, re-run the sys.database_mirroring query; confirm mirroring_state_desc shows SYNCHRONIZED before attempting the failover again.
  • Alternative (Last Resort): If immediate failover is required and data loss is acceptable (e.g., disaster recovery scenario), execute ALTER DATABASE <DBName> SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS; on the mirror instance to bring it online immediately.

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

Troubleshooting Guide: Error 1423 – “The Property Name Is Not Supported”

Why This Error Happens

Error 1423 in Microsoft SQL Server 2025 typically occurs when an application or script attempts to set or retrieve an Extended Property, SMO (SQL Management Object) property, or Database-level configuration property that does not exist in the current schema version or has been deprecated in this release. This often happens after an in-place upgrade from an older SQL Server version to SQL Server 2025, where legacy scripts reference property names that have been renamed or removed. It can also be triggered by a mismatch between the SQL Server Management Objects (SMO) DLL version installed on Windows Server 2025 / Windows 11 and the actual Database Engine version being queried.

Step-by-Step Resolution Guide

Step 1: Identify the Exact Property Causing the Conflict

  • Check the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the specific object and property name throwing Error 1423.
  • Run the failing T-SQL command manually in SQL Server Management Studio (SSMS) to isolate whether it is a sp_addextendedproperty, DATABASEPROPERTYEX, or SMO scripting issue.
  • Cross-reference the property name against the official SQL Server 2025 Breaking Changes documentation to confirm if it was deprecated.

Step 2: Update or Repair SQL Server Management Objects (SMO)

  • Open Control Panel > Programs > Programs and Features on Windows Server 2025 / Windows 11.
  • Locate “Microsoft SQL Server 2025 Management Objects” and select Repair.
  • Alternatively, reinstall the latest SMO package via the SQL Server Feature Pack to ensure the PowerShell/SMO libraries match the Database Engine build number exactly.
  • Restart the SQL Server Agent and SQL Server (MSSQLSERVER) services via services.msc after the repair completes.

Step 3: Correct the Property Name in the Script or Application Code

  • If using sp_addextendedproperty, verify the syntax matches the SQL Server 2025 schema (e.g., ensure @level0type and @level1type values are valid strings like 'SCHEMA' or 'TABLE', as case sensitivity rules have tightened in this build).
  • Update any third-party backup or monitoring tools (e.g., legacy PowerShell modules) to their latest version compatible with SQL Server 2025.
  • If the property belongs to a Database Diagram or Maintenance Plan, delete and recreate the object to force SQL Server to regenerate the property metadata correctly.

Step 4: Clear the Plan Cache and Metadata Cache

  • Execute DBCC FREEPROCCACHE to remove potentially corrupted cached execution plans referencing the invalid property.
  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS to ensure no underlying system table corruption is causing the metadata lookup to fail.

Alternative or Verification Steps

  • Verification: Re-run the original query or SSMS action; Error 1423 should no longer appear, and executing SELECT * FROM sys.extended_properties should display the corrected property name without throwing an exception.
  • Alternative Fix: If the error persists after repairing SMO, uninstall and perform a clean install of the SQL Server 2025 Native Client and Command Line Utilities, as a corrupted driver installation on Windows 11 can sometimes mimic this specific property error.

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

Troubleshooting Guide: SQL Server Error 1424 — Property Value Not Changed

Why This Error Happens

This error occurs during replication configuration changes when SQL Server detects that the distributor or publisher metadata on the remote server instance already contains a newer timestamp or value for a given property than the one being pushed from the local instance. This typically happens due to replication metadata conflicts caused by out-of-sync snapshot agents, concurrent administrative changes made directly at the remote server, or replay of an older configuration script against a instance that has already been updated. It is a safeguard mechanism in SQL Server’s replication engine (MSrepl_commands) to prevent older configuration values from overwriting newer, authoritative ones.

Step-by-Step Resolution Guide

Step 1: Identify the Conflicting Property and Source

  • Open SQL Server Management Studio (SSMS) and connect to the Distributor instance.
  • Run the following query to inspect replication property history:
  SELECT * FROM distribution.dbo.MSrepl_originators;
  SELECT * FROM distribution.dbo.MSdistribution_history ORDER BY time DESC;
  • Check the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the exact property name referenced in the %.*ls placeholder (e.g., sync_type, publisher_login, or subscription_type).

Step 2: Synchronize Replication Metadata Manually

  • On the remote server instance, open a new query window and execute sp_helpdistpublisher to confirm current property values.
  • If the remote value is confirmed as the correct/intended one, update the local publisher/distributor configuration to match it using:
  EXEC sp_changedistpublisher @publisher = 'YourPublisherName', @property = 'PropertyName', @value = 'CorrectValue';
  • Ensure both instances are running the same SQL Server 2025 build/patch level via SELECT @@VERSION; to rule out version-specific replication schema mismatches.

Step 3: Reinitialize the Replication Agents

  • Stop the Snapshot Agent and Log Reader Agent jobs via SQL Server Agent (in SSMS, expand SQL Server Agent > Jobs).
  • Right-click the affected publication, select Reinitialize All Subscriptions, and check Use a new snapshot.
  • Restart the agents and monitor the Replication Monitor (right-click Replication folder > Launch Replication Monitor) for successful synchronization without the 1424 warning reappearing.

Step 4: Validate Permissions on the Remote Instance

  • Confirm the account running the Distribution Agent has db_owner rights on the distribution database and is a member of the publication access list (PAL).
  • Use EXEC sp_helppublication_access to verify the PAL includes the correct login used for the remote connection.
  • Restart the SQL Server Agent service (services.msc → SQL Server Agent (MSSQLSERVER) → Restart) on both Windows Server 2025 instances to clear cached security tokens.

Alternative or Verification Steps

  • Verify the fix by querying distribution.dbo.MSrepl_errors to confirm no new Error 1424 entries appear after the next scheduled synchronization cycle.
  • If the error persists, drop and recreate the publication/subscription pair entirely using sp_dropsubscription and sp_droppublication, then rebuild via the New Publication Wizard in SSMS to force a clean metadata state.

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

Troubleshooting Guide: Error 1419 – Remote Database Copy Cannot Be Opened

Why This Error Happens

Error 1419 typically occurs during database mirroring or Always On Availability Group configuration when SQL Server 2025 cannot locate or access the specified database on the partner/mirror server in the expected “RESTORING” state. This usually happens because the database name was misspelled, the database was never restored with the NORECOVERY option on the secondary instance, or a previous restore operation completed and brought the database fully online (removing it from the restoring state). It can also occur if the mirroring endpoint lost sync with the partner server due to network interruptions or a service restart that altered the database’s recovery status.

Step-by-Step Resolution Guide

Step 1: Verify the Database Name and State on the Partner Server

  • Open SQL Server Management Studio (SSMS) and connect to the mirror/secondary instance.
  • Run the following query to check current database state:
  SELECT name, state_desc FROM sys.databases WHERE name = 'YourDatabaseName';
  • Confirm state_desc returns RESTORING. If it shows ONLINE, the database has already been recovered and is no longer eligible for mirroring.

Step 2: Re-Restore the Database with NORECOVERY

  • If the database is online or missing, restore a fresh full backup with the NORECOVERY clause to place it back into the correct state:
  RESTORE DATABASE [YourDatabaseName] 
  FROM DISK = 'C:\Backups\YourDatabase_Full.bak' 
  WITH NORECOVERY, REPLACE;
  • Apply any subsequent transaction log backups using WITH NORECOVERY to keep the database in the restoring state.
  • Ensure the backup file path is accessible from the Windows Server 2025 instance and that the SQL Server service account has read permissions on that folder.

Step 3: Validate the Mirroring Endpoint and Network Configuration

  • On both principal and mirror servers, confirm the mirroring endpoint is started:
  SELECT name, state_desc FROM sys.database_mirroring_endpoints;
  • Check Windows Firewall (via wf.msc) on both Windows Server 2025 machines to ensure the TCP port used for mirroring (commonly 5022) is open for inbound/outbound traffic.
  • Re-run the mirroring setup command on the principal server, explicitly specifying the correct, case-sensitive database name:
  ALTER DATABASE [YourDatabaseName] SET PARTNER = 'TCP://MirrorServer.domain.com:5022';

Step 4: Check SQL Server Error Logs for Underlying Causes

  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG (adjust instance version folder as needed for SQL Server 2025).
  • Look for related errors such as failed log shipping jobs, authentication failures, or endpoint connection timeouts that may indicate why the database dropped out of the restoring state.

Alternative or Verification Steps

  • Verify the fix by querying sys.database_mirroring on the mirror instance and confirming mirroring_state_desc returns SYNCHRONIZED or SYNCHRONIZING.
  • If mirroring continues to fail, consider switching to an Always On Availability Group configuration instead, which offers improved automatic failover and state management in SQL Server 2025.

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

Troubleshooting Guide: Error 1420 – Database Mirroring Unable to Obtain Network Hostname

Why This Error Happens

Error 1420 occurs when SQL Server’s database mirroring endpoint cannot resolve the local machine’s network hostname through the underlying Windows networking APIs, typically due to a failure in the gethostname() or DNS resolution call. This is commonly caused by a misconfigured or disabled network adapter, a corrupted TCP/IP stack, incorrect DNS server settings, or the server not being properly registered in DNS. It can also occur when multiple network interfaces create ambiguous hostname resolution, or when firewall rules block the mirroring endpoint from completing its handshake.

Step-by-Step Resolution Guide

Step 1: Verify Basic Network and Hostname Configuration

  • Open Command Prompt as Administrator and run hostname to confirm the machine name resolves correctly.
  • Run ipconfig /all and confirm the server has a valid IPv4 address, subnet mask, and default gateway.
  • Check that the DNS suffix is correctly appended under Control Panel > Network and Sharing Center > Change Adapter Settings > Properties > Internet Protocol Version 4 (TCP/IPv4) > Advanced > DNS.

Step 2: Flush DNS and Re-Register the Host Record

  • Run ipconfig /flushdns followed by ipconfig /registerdns to clear and refresh the DNS cache.
  • Confirm the server’s A record exists in DNS Manager (dnsmgmt.msc) on your DNS server, pointing to the correct IP.
  • Restart the DNS Client service via services.msc or run net stop dnscache && net start dnscache.

Step 3: Validate the Database Mirroring Endpoint Configuration

  • Open SQL Server Management Studio (SSMS) and run:
  SELECT * FROM sys.database_mirroring_endpoints;
  • Confirm the endpoint STATE is STARTED and the PORT (default 5022) is not blocked.
  • Verify the endpoint uses a valid listener IP; avoid binding to 0.0.0.0 if multiple NICs are present—specify the correct IP explicitly.

Step 4: Check Windows Firewall and Port Accessibility

  • Open Windows Defender Firewall with Advanced Security and ensure an inbound rule exists for TCP port 5022 (or your custom mirroring port).
  • Test connectivity between the principal and mirror servers using:
  Test-NetConnection -ComputerName <MirrorServerName> -Port 5022
  • Disable any third-party firewall/antivirus temporarily to rule out interference, then re-enable once confirmed.

Step 5: Restart Networking Services and SQL Server

  • Restart the Windows Server 2025 network adapter via Device Manager or run netsh interface ip reset.
  • Restart the SQL Server (MSSQLSERVER) and SQL Server Agent services via services.msc.
  • Reboot the server if hostname resolution issues persist after network stack reset.

Alternative or Verification Steps

  • Verify the fix by re-running the ALTER DATABASE <DBName> SET PARTNER = 'TCP://<MirrorServer>:5022' command and confirming no Error 1420 is thrown.
  • If the issue persists, use a static IP with a manually mapped hostname entry in the local C:\Windows\System32\drivers\etc\hosts file as a temporary workaround while DNS issues are resolved.

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

Troubleshooting Guide: Error 1421 – Communications to Remote Server Instance Failed

Why This Error Happens

Error 1421 typically occurs during database mirroring or Always On Availability Group configuration when SQL Server cannot establish a timely connection to the partner/remote instance. This is most often caused by firewall rules blocking the mirroring endpoint port (default 5022), incorrect endpoint configuration, or the remote SQL Server service being unresponsive due to high latency or resource exhaustion. In some cases, the TCP timeout value is simply too low for the network conditions between the primary and secondary replicas.

Step-by-Step Resolution Guide

Step 1: Verify the Database Mirroring Endpoint Status

  • Open SQL Server Management Studio (SSMS) and connect to both the principal and mirror/secondary instances.
  • Run the following query on each instance to confirm the endpoint is started:
  SELECT name, state_desc, port FROM sys.database_mirroring_endpoints;
  • If state_desc shows STOPPED, start it manually:
  ALTER ENDPOINT [Mirroring] STATE = STARTED;

Step 2: Check Windows Firewall and Port Accessibility

  • On Windows Server 2025, open Windows Defender Firewall with Advanced Security.
  • Create an inbound rule allowing TCP traffic on port 5022 (or your custom mirroring port) for the sqlservr.exe process.
  • Test connectivity between servers using PowerShell:
  Test-NetConnection -ComputerName <RemoteServerName> -Port 5022
  • If the test fails, confirm no network ACLs, VPN tunnels, or Azure NSGs are blocking the path.

Step 3: Increase the ALTER DATABASE Command Timeout

  • In SSMS, go to Tools > Options > Query Execution > SQL Server > General.
  • Increase the “Execution time-out” value from the default (often 0 or 30 seconds) to 120 seconds or higher.
  • If running via script, set the timeout explicitly in your connection string or SQLCMD session:
  :CONNECT TargetServer -t 120

Step 4: Validate Service Account Permissions

  • Ensure the SQL Server service account on both instances has CONNECT permission on the mirroring endpoint.
  • Grant permissions explicitly if missing:
  GRANT CONNECT ON ENDPOINT::[Mirroring] TO [DOMAIN\SQLServiceAccount];
  • Restart the SQL Server service via Services.msc or net stop MSSQLSERVER && net start MSSQLSERVER after applying changes.

Step 5: Review SQL Server Error Logs for Network Latency

  • Open the SQL Server Error Log (via SSMS Object Explorer > Management > SQL Server Logs).
  • Look for repeated timeout warnings or “login failed” entries around the time of the 1421 error.
  • Cross-reference with Event Viewer > Windows Logs > System for network adapter or NIC driver issues on Windows Server 2025.

Alternative or Verification Steps

  • Re-run the original ALTER DATABASE mirroring/availability group command and confirm it completes without timeout errors; check sys.database_mirroring_endpoints again to validate state_desc = STARTED on both nodes.
  • If the issue persists, drop and recreate the mirroring endpoint entirely using CREATE ENDPOINT with explicit port and encryption settings, then re-establish the partnership from scratch.

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

Troubleshooting Guide: SQL Server Error 1416 – “Database Is Not Configured for Database Mirroring”

Why This Error Happens

Error 1416 occurs when an ALTER DATABASE SET PARTNER or SET WITNESS command is issued against a database that was never initialized as a mirroring endpoint. This typically happens because the database mirroring session was never established via ALTER DATABASE... SET PARTNER, the mirroring metadata was removed after a failover or manual break, or the command is being run against the wrong database (e.g., a restored copy that lacks the mirroring LSN chain). It can also surface if the database was recently migrated to SQL Server 2025 and the mirroring configuration was not re-established after restore.

Step-by-Step Resolution Guide

Step 1: Verify the Database Mirroring State

  • Open SQL Server Management Studio (SSMS) and connect to the principal instance.
  • Run SELECT name, mirroring_state_desc FROM sys.database_mirroring WHERE database_id = DB_ID('YourDatabaseName');
  • If mirroring_state_desc returns NULL, the database is confirmed as not configured for mirroring.

Step 2: Re-Establish Full Backup Chain for Mirroring

  • On the Principal server, take a full backup: BACKUP DATABASE [YourDatabaseName] TO DISK = 'C:\Backups\YourDatabaseName.bak';
  • Immediately follow with a transaction log backup: BACKUP LOG [YourDatabaseName] TO DISK = 'C:\Backups\YourDatabaseName.trn';
  • Restore both files on the Mirror server using WITH NORECOVERY, ensuring the database is left in a restoring state (required for mirroring to initialize).

Step 3: Configure Mirroring Endpoints

  • On both Principal and Mirror instances, verify the TCP endpoint exists: SELECT * FROM sys.database_mirroring_endpoints;
  • If missing, create it: CREATE ENDPOINT Mirroring STATE = STARTED AS TCP (LISTENER_PORT = 5022) FOR DATABASE_MIRRORING (ROLE = PARTNER);
  • Ensure Windows Firewall on Windows Server 2025 allows inbound/outbound traffic on port 5022 for both nodes.

Step 4: Set the Partner Relationship

  • On the Mirror instance, run: ALTER DATABASE [YourDatabaseName] SET PARTNER = 'TCP://PrincipalServer.domain.com:5022';
  • On the Principal instance, run: ALTER DATABASE [YourDatabaseName] SET PARTNER = 'TCP://MirrorServer.domain.com:5022';
  • Confirm the Service Accounts running SQL Server have CONNECT permission on the mirroring endpoint (GRANT CONNECT ON ENDPOINT::Mirroring TO [DOMAIN\SQLServiceAccount];).

Step 5: Validate Session Synchronization

  • Re-query sys.database_mirroring on both instances; mirroring_state_desc should now show SYNCHRONIZING or SYNCHRONIZED.
  • Check the SQL Server Error Log for any “Database Mirroring connection error” entries that indicate authentication or network-level blocking.

Alternative or Verification Steps

  • Quick Verification: In SSMS, right-click the database → Properties → Mirroring page. The status should display “Synchronized” instead of being grayed out or blank.
  • Fallback Option: If mirroring still fails to initialize due to legacy incompatibility, consider migrating to Always On Availability Groups, which is the Microsoft-recommended high-availability solution going forward, as Database Mirroring is a deprecated feature slated for removal in future SQL Server versions.

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

Troubleshooting Guide: Error 1417 – Database Mirroring Disabled by Administrator

Why This Error Happens

This error occurs when database mirroring has been explicitly turned off at the database level, either through the ALTER DATABASE SET PARTNER OFF command or because the mirroring endpoint was manually disabled by a DBA. It can also surface after a failed upgrade or migration process where mirroring metadata was retained in sys.database_mirroring but the underlying endpoint state was revoked. In some cases, Group Policy or security hardening scripts on Windows Server 2025 may have disabled the TCP endpoint used for the mirroring session, causing SQL Server to reject mirroring operations as a safety measure.

Step-by-Step Resolution Guide

Step 1: Verify Current Mirroring State

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Run the following query to check the mirroring status:
  SELECT name, mirroring_state_desc FROM sys.database_mirroring WHERE mirroring_state_desc IS NOT NULL;
  • Confirm if the state shows SUSPENDED or DISCONNECTED, which confirms an administrative shutdown.

Step 2: Re-enable the Mirroring Endpoint

  • Navigate to Server Objects > Endpoints in SSMS Object Explorer.
  • Locate the Database_Mirroring endpoint and ensure its state is set to STARTED.
  • Alternatively, run this T-SQL command to force the endpoint active:
  ALTER ENDPOINT [Mirroring] STATE = STARTED;

Step 3: Re-establish the Partnership

  • Since mirroring was explicitly turned off, you must reset the partner relationship rather than just restarting the service.
  • On the Principal server, run:
  ALTER DATABASE [YourDB] SET PARTNER = 'TCP://MirrorServer.domain.com:5022';
  • Ensure the Windows Firewall on Windows Server 2025 allows inbound/outbound traffic on port 5022 for the sqlservr.exe process.

Step 4: Check Certificate and Login Permissions

  • If mirroring was disabled due to a security policy change, verify that the SQL Server service account has CONNECT permissions on the endpoint.
  • Run the following to grant necessary permissions if missing:
  GRANT CONNECT ON ENDPOINT::[Mirroring] TO [DOMAIN\ServiceAccount];

Alternative or Verification Steps

  • Verify the Fix: Query sys.database_mirroring again; the mirroring_state_desc should now read SYNCHRONIZED or SYNCHRONIZING instead of DISCONNECTED.
  • Alternative Solution: If the partnership cannot be restored due to data divergence, break the mirroring session entirely using ALTER DATABASE [YourDB] SET PARTNER OFF, and consider migrating to an Always On Availability Group, which is the recommended high-availability solution for SQL Server 2025 going forward.

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

Troubleshooting Guide: SQL Server Error 1418 — “The server network address cannot be reached or does not exist”

Why This Error Happens

This error typically occurs during database mirroring or Always On Availability Group configuration when SQL Server cannot establish a connection to the specified endpoint address of the partner or mirror server. The root cause is usually an incorrect or unreachable network address in the ENDPOINT definition, a blocked or misconfigured port (default 5022) in the Windows Firewall, or a DNS resolution failure preventing the server name from being translated to an IP address. Additionally, mismatched service accounts without proper CONNECT permissions on the mirroring endpoint can trigger this same error even when network connectivity is otherwise healthy.

Step-by-Step Resolution Guide

Step 1: Verify Network Connectivity and DNS Resolution

  • Open Command Prompt on both the principal and mirror/secondary servers.
  • Run ping <servername> and nslookup <servername> to confirm the FQDN resolves to the correct IP address.
  • If DNS fails, manually test connectivity using Test-NetConnection -ComputerName <servername> -Port 5022 in PowerShell.
  • Correct any stale DNS entries in the Windows Server 2025 DNS Manager or add a static entry in the hosts file as a temporary workaround.

Step 2: Confirm the Endpoint Configuration in SQL Server

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Run the following query to inspect the endpoint status and port:
  SELECT name, type_desc, state_desc, port 
  FROM sys.tcp_endpoints;
  • Ensure the state_desc shows STARTED. If it shows STOPPED, restart it using:
  ALTER ENDPOINT [Mirroring] STATE = STARTED;
  • Verify the ENDPOINT definition uses the correct listener port (default 5022) and that the server address specified in the mirroring/AG setup matches the actual hostname or IP.

Step 3: Check Windows Firewall and Port Accessibility

  • Navigate to Windows Defender Firewall with Advanced Security on both Windows Server 2025 instances.
  • Create or verify an Inbound Rule allowing TCP traffic on port 5022 (or your custom mirroring port).
  • Run netstat -ano | findstr 5022 on the hosting server to confirm SQL Server is actively listening on that port.
  • If using a cloud VM or NSG (Network Security Group), confirm the corresponding inbound rule is open at the network layer as well.

Step 4: Validate Service Account Permissions on the Endpoint

  • Confirm the SQL Server service account has CONNECT permission on the mirroring endpoint by running:
  GRANT CONNECT ON ENDPOINT::[Mirroring] TO [DOMAIN\ServiceAccount];
  • Ensure certificates (if using certificate-based authentication instead of Windows Authentication) are valid and not expired on both partner instances.

Step 5: Re-test the Mirroring or Availability Group Connection

  • Re-run the ALTER DATABASE mirroring command or re-establish the Availability Group replica connection via SSMS.
  • Monitor the SQL Server Error Log and Windows Event Viewer (Application log) for confirmation that Error 1418 no longer appears.

Alternative or Verification Steps

  • Use SELECT * FROM sys.dm_hadr_availability_replica_states; (for Always On) or check the Database Mirroring Monitor in SSMS to confirm the partner server shows a Connected status instead of Disconnected.
  • If the issue persists after verifying network and endpoint settings, try temporarily disabling the firewall on both servers (lab/test environments only) to isolate whether the issue is strictly port-blocking related, then re-enable it with a properly scoped rule.

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

Troubleshooting Guide: Error 1413 — Database Mirroring Communication Failure in SQL Server 2025

Why This Error Happens

Error 1413 occurs when the principal server instance attempts to establish a database mirroring session with the mirror server, but the mirroring endpoint on the remote instance is not yet started, not reachable, or not properly configured. This is commonly caused by the mirroring endpoint being in a stopped state, firewall rules blocking the designated mirroring port (typically 5022), DNS/network name resolution failures between the principal and mirror instances, or a mismatch in the service account permissions required to authenticate the endpoint connection. In some cases, the error also surfaces transiently if the ALTER DATABASE command is issued before the mirror database has fully completed its restore with NORECOVERY state.

Step-by-Step Resolution Guide

Step 1: Verify the Database Mirroring Endpoint Status

  • Open SQL Server Management Studio (SSMS) and connect to the mirror instance.
  • Run the following query to check endpoint state: SELECT name, state_desc, port FROM sys.database_mirroring_endpoints;
  • If the state_desc shows STOPPED, start it manually using: ALTER ENDPOINT [Mirroring] STATE = STARTED;

Step 2: Confirm Network Connectivity and Port Accessibility

  • From the principal server, test connectivity to the mirror server using PowerShell: Test-NetConnection -ComputerName <MirrorServerName> -Port 5022
  • Ensure Windows Defender Firewall (on both Windows Server 2025 and Windows 11 clients) has an inbound rule allowing TCP traffic on port 5022.
  • Navigate to Control Panel > Windows Defender Firewall > Advanced Settings > Inbound Rules and create a new rule for SQL Server Database Mirroring if one does not already exist.

Step 3: Validate Service Account Permissions on the Endpoint

  • Confirm that the SQL Server service account running the mirror instance has CONNECT permission on the mirroring endpoint.
  • Run this command on the mirror instance to grant access if missing: GRANT CONNECT ON ENDPOINT::[Mirroring] TO [DOMAIN\ServiceAccount];
  • Verify the endpoint is using the correct authentication mode (Windows Authentication or Certificate-based) matching the configuration on the principal instance.

Step 4: Restart the Mirroring Session

  • On the principal server, re-issue the ALTER DATABASE command once the mirror instance confirms a STARTED endpoint state.
  • Example command: ALTER DATABASE [YourDatabaseName] SET PARTNER = 'TCP://MirrorServerName:5022';
  • Allow a few seconds for the handshake to complete before checking status again.

Alternative or Verification Steps

  • Verify the fix by querying SELECT * FROM sys.database_mirroring WHERE mirroring_state_desc = 'SYNCHRONIZED'; on the principal server to confirm the mirroring state has moved past SUSPENDED or DISCONNECTED.
  • If the issue persists, drop and recreate the mirroring endpoint on both instances using DROP ENDPOINT [Mirroring] followed by a fresh CREATE ENDPOINT statement, ensuring port and certificate configurations match exactly on both the principal and mirror servers.

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

Troubleshooting Guide: Error 1414 – Database Mirroring Initialization Failure

Why This Error Happens

Error 1414 occurs when SQL Server 2025 attempts to close the database connection before the database mirroring session has been fully established between the principal and mirror servers. This is typically caused by network connectivity issues between the instances, mismatched endpoint configurations (ports/certificates), or the mirroring endpoint not being in a “STARTED” state on one or both servers. It can also surface when the ALTER DATABASE command is issued too quickly after the mirroring endpoints are created, before Windows Server 2025 networking/firewall rules have propagated.

Step-by-Step Resolution Guide

Step 1: Verify Database Mirroring Endpoint Status

  • Run the following query on both the principal and mirror instances to confirm the endpoint state:
  SELECT name, state_desc, port, encryption_algorithm_desc 
  FROM sys.database_mirroring_endpoints;
  • If state_desc returns STOPPED, restart it manually:
  ALTER ENDPOINT [Mirroring] STATE = STARTED;
  • Confirm both endpoints are listening on the same designated TCP port (default is often 5022).

Step 2: Check Windows Firewall and Network Connectivity

  • On Windows Server 2025 / Windows 11, navigate to Windows Defender Firewall with Advanced Security.
  • Ensure an inbound rule exists allowing TCP traffic on the mirroring port (e.g., 5022) for both the Principal and Mirror servers.
  • Test connectivity between servers using PowerShell:
  Test-NetConnection -ComputerName <MirrorServerName> -Port 5022
  • If the connection fails, update the firewall rule or check for VLAN/subnet isolation blocking the SQL Server traffic.

Step 3: Validate Service Account Permissions

  • Open SQL Server Configuration Manager and verify that the SQL Server service account has the necessary login permissions on both instances.
  • On the Principal server, grant connect permissions to the Mirror server’s service account:
  GRANT CONNECT ON ENDPOINT::[Mirroring] TO [DOMAIN\MirrorServiceAccount];
  • Repeat this grant statement on the Mirror server, substituting the Principal server’s service account.

Step 4: Re-run the ALTER DATABASE Command with Delay

  • Once connectivity and permissions are confirmed, re-initiate the mirroring setup from the Principal server:
  ALTER DATABASE [YourDatabaseName] 
  SET PARTNER = 'TCP://MirrorServerName.domain.com:5022';
  • Allow a 10-15 second buffer between starting the endpoint services and executing this command to ensure Windows Server 2025 network stack fully initializes the socket listeners.

Alternative or Verification Steps

  • Verify the Fix: Check the mirroring status in SQL Server Management Studio (SSMS) under the database properties; the status should change from “Synchronizing” to “Synchronized” within a few minutes.
  • Alternative Solution: If the error persists due to certificate mismatches (common in Windows Server 2025 hardened security policies), drop and recreate the mirroring endpoints using explicit certificate authentication rather than Windows Authentication to bypass potential Kerberos delegation issues.

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

Why This Error Happens

Error 1415 typically occurs when the database mirroring endpoint is inaccessible, misconfigured, or blocked due to network and authentication issues between the principal and mirror servers. This is often caused by a firewall blocking the mirroring TCP port (default 5022), an expired or mismatched certificate/SPN used for endpoint authentication, or the mirroring endpoint being in a STOPPED state. Additionally, a mismatch in database states (e.g., the mirror database not being properly restored with NORECOVERY) can trigger this failure.

Step-by-Step Resolution Guide

Step 1: Verify the Database Mirroring Endpoint Status

  • Open SQL Server Management Studio (SSMS) and connect to both the Principal and Mirror instances.
  • Run the following query on each instance to check the endpoint state:
SELECT name, state_desc, port FROM sys.database_mirroring_endpoints;
  • If the state_desc shows STOPPED, restart it using:
ALTER ENDPOINT [Mirroring] STATE = STARTED;

Step 2: Check Firewall and Network Connectivity

  • Ensure Windows Defender Firewall (or any third-party firewall) on both Windows Server 2025/Windows 11 machines allows inbound/outbound traffic on the mirroring port (default 5022).
  • Use PowerShell to add an inbound rule if missing:
New-NetFirewallRule -DisplayName "SQL Mirroring" -Direction Inbound -Protocol TCP -LocalPort 5022 -Action Allow
  • Test connectivity between servers using Test-NetConnection -ComputerName <MirrorServerName> -Port 5022.

Step 3: Validate Security Certificates and Permissions

  • If using certificate-based authentication, verify the certificate hasn’t expired:
SELECT name, expiry_date FROM sys.certificates WHERE name LIKE '%Mirroring%';
  • Ensure the SQL Server service account has CONNECT permission on the endpoint:
GRANT CONNECT ON ENDPOINT::[Mirroring] TO [DOMAIN\ServiceAccount];
  • If using Windows Authentication, confirm the correct SPN is registered using setspn -L <ServiceAccount>.

Step 4: Re-sync the Mirror Database State

  • Confirm the mirror database is in a RESTORING state (NORECOVERY) and not accidentally brought online.
  • If out of sync, re-run a full backup/restore sequence with NORECOVERY on the mirror instance:
RESTORE DATABASE [YourDB] FROM DISK = 'C:\Backup\YourDB.bak' WITH NORECOVERY;
  • Re-establish the mirroring session afterward via SSMS (Database Properties > Mirroring).

Alternative or Verification Steps

  • After applying fixes, check the SQL Server Error Log and Windows Event Viewer (Application Log) for Event ID 1415 recurrence; a clean log with no new entries confirms resolution.
  • As an alternative, consider migrating to an Always On Availability Group instead of legacy Database Mirroring, as it is more resilient and fully supported in SQL Server 2025.

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

Troubleshooting Guide: Error 1410 – Database Mirroring Already Enabled

Why This Error Happens

Error 1410 occurs when SQL Server attempts to establish a mirroring session on a database that already has a mirroring endpoint configured and active on the remote partner instance. This typically happens due to a previous mirroring setup that was not properly torn down, leftover metadata from a failed mirroring configuration attempt, or a duplicate ALTER DATABASE SET PARTNER command being issued against a database that is already paired. In some cases, this is also triggered when restoring a database backup that retains mirroring configuration from its source environment.

Step-by-Step Resolution Guide

Step 1: Verify Current Mirroring State on Both Instances

  • Connect to both the Principal and Mirror SQL Server 2025 instances using SQL Server Management Studio (SSMS) or sqlcmd.
  • Run the following query on each instance to check mirroring status:
  SELECT name, mirroring_state_desc, mirroring_role_desc, mirroring_partner_instance 
  FROM sys.database_mirroring 
  WHERE database_id = DB_ID('YourDatabaseName');
  • If mirroring_state_desc returns anything other than NULL, the database is already enrolled in a mirroring session.

Step 2: Remove the Existing Mirroring Configuration

  • On the instance showing an active mirroring state, run:
  ALTER DATABASE [YourDatabaseName] SET PARTNER OFF;
  • Execute this command on both the Principal and Mirror instances to fully clear the session state.
  • Wait 10-15 seconds to allow SQL Server to flush the mirroring metadata before proceeding.

Step 3: Validate and Clean Up Mirroring Endpoints

  • Check for orphaned or duplicate endpoints using:
  SELECT name, type_desc, state_desc, port 
  FROM sys.tcp_endpoints 
  WHERE type_desc = 'DATABASE_MIRRORING';
  • If duplicate endpoints exist (common after a failed cluster failover in Windows Server 2025 environments), drop the redundant one:
  DROP ENDPOINT [Mirroring_Endpoint_Name];
  • Recreate the endpoint only if necessary, ensuring the port (default 5022) is not blocked by Windows Defender Firewall on Windows Server 2025.

Step 4: Re-Establish the Mirroring Session

  • On the Mirror instance, restore the database with NORECOVERY:
  RESTORE DATABASE [YourDatabaseName] FROM DISK = 'C:\Backups\YourDatabaseName.bak' WITH NORECOVERY;
  • On the Principal instance, initiate the partner relationship:
  ALTER DATABASE [YourDatabaseName] SET PARTNER = 'TCP://MirrorServerName.domain.com:5022';
  • On the Mirror instance, confirm the reciprocal partner setting:
  ALTER DATABASE [YourDatabaseName] SET PARTNER = 'TCP://PrincipalServerName.domain.com:5022';

Alternative or Verification Steps

  • Confirm mirroring is healthy by checking mirroring_state_desc returns SYNCHRONIZED on both instances, and review the SQL Server Error Log for Event ID confirmations of a successful partner handshake.
  • If the error persists, consider removing mirroring entirely via ALTER DATABASE [YourDatabaseName] SET PARTNER OFF and switching to Always On Availability Groups, which is the recommended high-availability solution in SQL Server 2025 moving forward.

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

Why This Error Happens

Error 1411 occurs because the secondary database in a log shipping or mirroring configuration is missing one or more transaction log backups required to reach a consistent recovery point. This typically happens when a log backup file was skipped, deleted, or failed to copy before being restored, breaking the sequential Log Sequence Number (LSN) chain. It can also occur if multiple files within the same database (such as separate filegroups) were restored using backups taken at different, non-aligned points in time.

Step-by-Step Resolution Guide

Step 1: Verify the LSN Chain Continuity

  • Run RESTORE HEADERONLY FROM DISK = 'Z:\Backups\LogBackup.trn' on each log backup file to inspect the FirstLSN and LastLSN values.
  • Confirm that the LastLSN of one backup matches the FirstLSN of the next file in the restore sequence with no gaps.
  • Check the msdb.dbo.backupset table on the primary server to identify any missing backup_set_id entries in the sequence.

Step 2: Inspect the Log Shipping Job History

  • Open SQL Server Management Studio (SSMS), navigate to SQL Server Agent > Jobs, and review the history for the LSBackup_, LSCopy_, and LSRestore_ jobs.
  • Check the physical backup share folder (e.g., \\FileServer\LogShipping\) to ensure no .trn files are missing due to disk cleanup policies or network share permission failures.
  • Validate that the Windows service account running the SQL Server Agent has Read/Write access to the share via Properties > Security in Windows Explorer.

Step 3: Re-initialize the Secondary Database

  • If a gap in the LSN chain is confirmed and cannot be patched with a missing file, you must re-seed the secondary database.
  • Take a fresh Full Backup of the primary database using BACKUP DATABASE [YourDB] TO DISK = 'Z:\Backups\Full.bak' WITH INIT.
  • Restore this new full backup on the secondary server using WITH NORECOVERY to reset the baseline for the log chain.
  • Resume the standard log shipping or Always On schedule to apply logs moving forward.

Step 4: Check for Filegroup Restore Mismatches

  • If the database uses multiple files or filegroups, ensure all files were backed up and restored as part of the same “point-in-time” logical backup set.
  • Avoid restoring a differential or log backup that only targets a single filegroup unless the primary was also split-restored at that exact LSN.

Alternative or Verification Steps

  • Verify: Query the secondary database state using SELECT name, state_desc FROM sys.databases WHERE name = 'YourDB';. If the state has changed from RESTORING to the expected SYNCHRONIZED or NORECOVERY status without further errors, the chain has been successfully restored.
  • Alternative: If re-seeding via tape or disk backup is too slow for a large database, use the sp_add_log_shipping_secondary_primary stored procedure to force a full re-initialization directly over the network, bypassing manual file copy steps.

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

Troubleshooting Guide: SQL Server Error 1412

Why This Error Happens

Error 1412 occurs in SQL Server Database Mirroring or Availability Group configurations when the log sequence number (LSN) on the mirror/secondary replica does not align with what the principal/primary expects, meaning the transaction log chain has a gap or mismatch. This is typically caused by the secondary database being restored from a backup taken after mirroring was initially configured, a broken log backup chain, or an interrupted log-shipping sequence that prevented full log synchronization. It can also surface after an unexpected failover where the secondary was not rolled forward to the exact LSN present in the principal’s active transaction log.

Step-by-Step Resolution Guide

Step 1: Verify the Mirroring/AG Session State

  • Open SQL Server Management Studio (SSMS) and connect to both the principal and mirror/secondary instances.
  • Run the following query on both instances to check synchronization status:
SELECT DB_NAME(database_id) AS DatabaseName, mirroring_state_desc, mirroring_role_desc
FROM sys.database_mirroring
WHERE mirroring_guid IS NOT NULL;
  • Confirm whether the state shows “SUSPENDED” or “DISCONNECTED,” which indicates the LSN mismatch described in Error 1412.

Step 2: Re-establish the Log Chain with a Fresh Full Backup

  • On the principal database, take a new full backup:
BACKUP DATABASE [YourDatabaseName] TO DISK = 'C:\Backup\YourDatabaseName_Full.bak';
  • Take a transaction log backup immediately after:
BACKUP LOG [YourDatabaseName] TO DISK = 'C:\Backup\YourDatabaseName_Log.trn';
  • Copy both backup files to the mirror/secondary server (e.g., C:\Backup\ on Windows Server 2025).

Step 3: Restore the Database on the Mirror with NORECOVERY

  • Restore the full backup on the mirror instance using NORECOVERY so it remains in a restoring state:
RESTORE DATABASE [YourDatabaseName] FROM DISK = 'C:\Backup\YourDatabaseName_Full.bak' WITH NORECOVERY;
  • Apply the transaction log backup to roll it forward correctly:
RESTORE LOG [YourDatabaseName] FROM DISK = 'C:\Backup\YourDatabaseName_Log.trn' WITH NORECOVERY;
  • Ensure no additional transactions occurred on the principal between backup and restore to avoid reintroducing the LSN gap.

Step 4: Re-initiate the Mirroring or Availability Group Session

  • On the principal, re-run the ALTER DATABASE command to restart mirroring:
ALTER DATABASE [YourDatabaseName] SET PARTNER = 'TCP://MirrorServerName:5022';
  • For Availability Groups, instead use SSMS’s “Add Database” wizard under the AG node, or run:
ALTER DATABASE [YourDatabaseName] SET HADR AVAILABILITY GROUP = [YourAGName];
  • Monitor the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for confirmation that synchronization has resumed.

Step 5: Check Network and Endpoint Configuration

  • Verify the mirroring endpoint is listening correctly on both servers:
SELECT name, port, state_desc FROM sys.tcp_endpoints;
  • Confirm Windows Firewall on Windows Server 2025 allows inbound/outbound traffic on port 5022 (or your custom mirroring port).

Alternative or Verification Steps

  • After completing the steps above, re-run the sys.database_mirroring query from Step 1 and confirm mirroring_state_desc shows “SYNCHRONIZED.”
  • If the error persists, consider removing mirroring entirely (ALTER DATABASE [YourDatabaseName] SET PARTNER OFF;) and rebuilding the mirror/secondary from scratch using a fresh full + log backup chain to eliminate any residual LSN corruption.

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

Troubleshooting Guide: SQL Server Error 1913 – Index or Statistics Name Already Exists

Why This Error Happens

This error occurs when a CREATE INDEX or CREATE STATISTICS statement attempts to use a name that is already assigned to another index or statistics object on the same table or indexed view. SQL Server enforces unique naming for these objects within the scope of a single table, so any naming collision—often caused by re-running deployment scripts, automated schema migrations, or duplicate statistics auto-created by the Query Optimizer—will trigger this failure. This is also commonly seen in Windows Server 2025 environments where CI/CD pipelines re-apply schema changes without checking for existing objects first.

Step-by-Step Resolution Guide

Step 1: Identify the Conflicting Object

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Run the following query to check existing indexes and statistics on the target table:
SELECT name, type_desc FROM sys.indexes WHERE object_id = OBJECT_ID('YourTableName');
SELECT name FROM sys.stats WHERE object_id = OBJECT_ID('YourTableName');
  • Confirm whether the name in the error message (e.g., %.*ls) matches an existing index or an auto-generated statistics object.

Step 2: Drop or Rename the Conflicting Object

  • If the existing object is obsolete or was created by a previous failed deployment, drop it safely:
DROP INDEX YourIndexName ON YourTableName;
-- or for statistics
DROP STATISTICS YourTableName.YourStatsName;
  • If the object is still needed, rename your new index/statistics definition in the deployment script instead of overwriting the existing one.

Step 3: Update Deployment Scripts to Prevent Recurrence

  • Modify automated scripts (DACPAC, Flyway, SSDT, or custom T-SQL) to include existence checks before creation:
IF NOT EXISTS (
    SELECT 1 FROM sys.indexes 
    WHERE name = 'YourIndexName' AND object_id = OBJECT_ID('YourTableName')
)
BEGIN
    CREATE INDEX YourIndexName ON YourTableName (ColumnName);
END
  • For statistics, disable auto-creation conflicts by checking sys.stats similarly before issuing CREATE STATISTICS.

Step 4: Re-run the Failed Operation

  • Execute the original CREATE INDEX or CREATE STATISTICS statement again.
  • Monitor SQL Server Error Logs via Windows Event Viewer → Applications and Services Logs → MSSQLSERVER to confirm Error 1913 no longer appears.

Alternative or Verification Steps

  • Verify the fix by querying sys.indexes and sys.stats again to confirm only one object exists with the intended name on the table.
  • If the error persists across multiple tables, consider enabling AUTOCREATESTATISTICS OFF temporarily during bulk schema deployments to rule out automatic statistics generation as the source of the naming conflict.

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

Troubleshooting Guide: SQL Server Error 1914 — “Index Cannot Be Created on Object”

Why This Error Happens

This error occurs when the CREATE INDEX statement targets a database object that SQL Server does not recognize as a valid user table or view, such as a system table, a synonym, a view without proper indexable properties, or an object that has been dropped or recreated with a schema mismatch. It can also happen when the target is actually a Common Table Expression (CTE), table-valued function, or an inline view alias rather than a persisted object. Additionally, metadata corruption in the system catalog (sys.objects) can cause SQL Server to misidentify a legitimate table as an invalid index target.

Step-by-Step Resolution Guide

Step 1: Verify the Object Type and Schema

  • Run SELECT name, type, type_desc FROM sys.objects WHERE name = 'YourObjectName'; in SQL Server Management Studio (SSMS) to confirm the object is a USER_TABLE or VIEW.
  • Check that the schema prefix (e.g., dbo., Sales.) matches exactly what is referenced in the CREATE INDEX statement.
  • Confirm the object isn’t actually a Synonym, External Table, or System Table by reviewing the type_desc column output.

Step 2: Rebuild or Recreate the Object Reference

  • If the object is a view, ensure it was created with SCHEMABINDING if you intend to build a unique clustered index on it.
  • Drop and recreate any synonyms pointing to the object: DROP SYNONYM YourSynonym; CREATE SYNONYM YourSynonym FOR dbo.ActualTable;
  • On Windows Server 2025, restart the SQL Server (MSSQLSERVER) service via services.msc or Restart-Service MSSQLSERVER in PowerShell to clear any cached execution plans referencing the stale object.

Step 3: Check for Catalog Corruption

  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORS; to scan for metadata corruption affecting sys.objects.
  • If corruption is found, restore from the latest clean backup or run DBCC CHECKDB with the appropriate repair option (REPAIR_REBUILD) during a maintenance window.
  • Validate file paths for the database’s .mdf and .ldf files under C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\ to ensure no I/O-level corruption exists.

Step 4: Recreate the Index with Correct Syntax

  • Use the fully qualified three-part name in your statement: CREATE INDEX IX_Test ON dbo.ActualTable (ColumnName);
  • Avoid referencing temp tables (#Temp) or table variables (@TableVar) directly with persistent index syntax — use inline index definitions instead for these objects.

Alternative or Verification Steps

  • After applying fixes, rerun the original CREATE INDEX statement in SSMS and confirm it completes with “Commands completed successfully” and no Error 1914.
  • As an alternative, query sys.indexes post-creation (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID('dbo.ActualTable');) to verify the index now exists and is correctly bound to the table.

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

Troubleshooting Guide: SQL Server Error 1409 – Database Mirroring/AG Log Restore Required

Why This Error Happens

This error occurs because the database on the secondary (mirror) instance is not in a RESTORING state with a matching Log Sequence Number (LSN) chain to the principal database. SQL Server requires that the secondary database be seeded via a full backup followed by one or more transaction log backups restored WITH NORECOVERY before mirroring or Availability Group synchronization can begin. If the log chain is broken—due to an intermediate backup restored WITH RECOVERY, a missed log backup, or a mismatched database state—SQL Server 2025 blocks the mirroring/join operation to prevent data divergence.

Step-by-Step Resolution Guide

Step 1: Verify the Current State of the Secondary Database

  • Open SQL Server Management Studio (SSMS) or run SELECT name, state_desc FROM sys.databases WHERE name = 'YourDatabaseName'; on the secondary replica.
  • Confirm the database shows RESTORING and not ONLINE or RECOVERING.
  • If the database is ONLINE, the log chain has already been broken and you must restart the seeding process from Step 2.

Step 2: Re-establish the Full Backup and Log Chain

  • On the primary server, take a fresh full backup:
    BACKUP DATABASE [YourDatabaseName] TO DISK = 'C:\Backups\YourDatabaseName_Full.bak';
  • Copy the .bak file to the secondary server (e.g., via a shared path like \\SecondaryServer\Backups\).
  • Restore it on the secondary with NORECOVERY:
    RESTORE DATABASE [YourDatabaseName] FROM DISK = 'C:\Backups\YourDatabaseName_Full.bak' WITH NORECOVERY;

Step 3: Apply Transaction Log Backups Without Recovery

  • On the primary, take a log backup:
    BACKUP LOG [YourDatabaseName] TO DISK = 'C:\Backups\YourDatabaseName_Log1.trn';
  • Restore each log backup sequentially on the secondary, always using NORECOVERY:
    RESTORE LOG [YourDatabaseName] FROM DISK = 'C:\Backups\YourDatabaseName_Log1.trn' WITH NORECOVERY;
  • Ensure no log backup is skipped and the LSN sequence is continuous (check sys.fn_dump_dbcc_log or backup history in msdb if unsure).

Step 4: Re-attempt Mirroring or AG Join

  • For Database Mirroring: Re-run the ALTER DATABASE [YourDatabaseName] SET PARTNER = 'TCP://PrimaryServer:5022'; command on the secondary.
  • For Availability Groups: Use the “Join Secondary to Availability Group” wizard in SSMS, or run:
    ALTER DATABASE [YourDatabaseName] SET HADR AVAILABILITY GROUP = [YourAGName];
  • Confirm no additional log backups were taken on the primary between your last restored log and the join operation (this would reintroduce the gap).

Step 5: Validate Service Accounts and Network Connectivity

  • Confirm the SQL Server service account has read/write permissions to the shared backup folder (\\SecondaryServer\Backups\).
  • Check that the endpoint ports (default 5022) are not blocked by Windows Firewall on Windows Server 2025:
    New-NetFirewallRule -DisplayName "SQL Mirroring" -Direction Inbound -Protocol TCP -LocalPort 5022 -Action Allow

Alternative or Verification Steps

  • Run SELECT database_id, synchronization_state_desc FROM sys.dm_hadr_database_replica_states; on the AG primary to confirm the secondary shows SYNCHRONIZED or SYNCHRONIZING rather than NOT SYNCHRONIZING.
  • If the issue persists, use the Always On Availability Groups Dashboard in SSMS to identify the exact LSN gap, or re-seed the database entirely using Automatic Seeding (ALTER AVAILABILITY GROUP ... MODIFY REPLICA ... SEEDING_MODE = AUTOMATIC) to bypass manual backup/restore errors.

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

Troubleshooting Guide: SQL Server Error 1911 – “Column name does not exist in the target table”

Why This Error Happens

This error occurs when a DML statement (typically INSERT, UPDATE, or a column-specific constraint/index definition) references a column name that SQL Server cannot locate in the target table’s current schema. The most common root cause is schema drift, where an application or script was written against an older or expected table definition, but the actual table was altered, recreated, or deployed with different column names (case sensitivity, typos, or renamed columns via sp_rename). It can also occur when working against a synonym, view, or linked server object whose underlying schema has changed without the dependent object being refreshed.

Step-by-Step Resolution Guide

Step 1: Verify the Actual Table Schema

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and connect to the instance on Windows Server 2025 / Windows 11.
  • Run sp_help 'YourTableName'; or query INFORMATION_SCHEMA.COLUMNS to get the exact, current column names.
  • Check for case sensitivity issues if the database collation is case-sensitive (e.g., SQL_Latin1_General_CP1_CS_AS).

Step 2: Compare Against the Failing Query or Script

  • Open the script, stored procedure, SSIS package, or application code generating Error 1911.
  • Cross-reference every column referenced in the INSERT INTO, UPDATE, or CREATE INDEX statement against the list obtained in Step 1.
  • Pay close attention to recently modified objects — check sys.objects for modify_date to see if the table was altered recently:
  SELECT name, modify_date FROM sys.objects WHERE name = 'YourTableName';

Step 3: Correct the Mismatch

  • If the column was renamed, update the application/script to use the new column name, or revert the rename using EXEC sp_rename 'Table.OldColumn', 'NewColumn', 'COLUMN'; if renaming was unintended.
  • If the column was dropped, either restore it via ALTER TABLE YourTable ADD ColumnName DataType; (if business logic requires it) or remove the obsolete reference from the query.
  • If using a Synonym or Linked Server, refresh the metadata using sp_refreshsqlmodule or drop/recreate the synonym to reflect the current schema.

Step 4: Refresh Cached Metadata (If Using Views or Procedures)

  • If the target is a VIEW, run sp_refreshview 'YourViewName'; to force SQL Server to re-validate the column list against the base table.
  • For stored procedures referencing the table, recompile using EXEC sp_recompile 'YourProcedureName'; to clear any stale execution plans holding outdated column metadata.

Alternative or Verification Steps

  • Verify the Fix: Re-run the original failing query in a test environment. If successful, execute DBCC CHECKTABLE('YourTableName') to ensure no underlying corruption contributed to the metadata mismatch.
  • Alternative: If the issue persists in an SSIS package, open the package in Visual Studio/SSDT and use “Refresh” on the OLE DB Destination component to resync the column mappings, as cached metadata in the .dtsx file is a common hidden cause of this error even after the SQL table is fixed.

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

Troubleshooting Guide: Error 1912 – Index DDL Operation Conflict in SQL Server 2025

Why This Error Happens

Error 1912 occurs when SQL Server attempts to perform an index DDL operation (such as CREATE INDEX, ALTER INDEX, or DROP INDEX) on an object that already has another concurrent operation locking it. This typically happens when an online index rebuild, another DDL statement, or a long-running transaction is holding a schema modification (Sch-M) or schema stability (Sch-S) lock on the same table or index. The conflict is a concurrency control mechanism designed to prevent data corruption, not a sign of database corruption itself.

Step-by-Step Resolution Guide

Step 1: Identify the Blocking Session

  • Open SQL Server Management Studio (SSMS) and connect to the target instance.
  • Run the following query to find sessions holding schema locks on the object:
SELECT request_session_id, resource_type, request_mode, request_status, resource_associated_entity_id
FROM sys.dm_tran_locks
WHERE resource_type IN ('OBJECT', 'METADATA')
AND request_mode LIKE 'Sch%';
  • Note the request_session_id of any conflicting long-running process.

Step 2: Check for Concurrent Index Operations

  • Query sys.dm_exec_requests to confirm if another index operation is currently in progress:
SELECT session_id, command, status, percent_complete, start_time
FROM sys.dm_exec_requests
WHERE command LIKE '%INDEX%';
  • If an online index rebuild is still running (status shows percent_complete increasing), allow it to finish before retrying your DDL command.

Step 3: Terminate or Wait Out the Conflicting Session

  • If the blocking session is stalled or orphaned, verify it is safe to terminate using sp_who2 or Activity Monitor.
  • If confirmed safe, kill the session using:
KILL <session_id>;
  • Avoid killing system or replication-related sessions (SPIDs below 50) as this may destabilize the instance.

Step 4: Retry the DDL Operation with WAITATLOW_PRIORITY

  • For SQL Server 2025, use the WAIT_AT_LOW_PRIORITY option to gracefully queue your index operation instead of failing immediately:
ALTER INDEX [YourIndexName] ON [YourSchema].[YourTable]
REBUILD WITH (ONLINE = ON (WAIT_AT_LOW_PRIORITY (MAX_DURATION = 5 MINUTES, ABORT_AFTER_WAIT = SELF)));
  • This prevents the operation from permanently blocking other transactions while waiting for the lock to clear.

Step 5: Review Windows Server Resource Contention

  • On Windows Server 2025, open Performance Monitor (perfmon.exe) and check for high disk I/O or CPU contention under the SQL Server process.
  • High resource contention can prolong existing DDL operations, increasing the likelihood of Error 1912 occurring during peak load windows.

Alternative or Verification Steps

  • Re-run the original index DDL statement during an off-peak maintenance window and confirm it completes without Error 1912 appearing in the SQL Server Error Log (Management > SQL Server Logs in SSMS).
  • If the issue persists despite no visible blocking sessions, restart the SQL Server service via Services.msc on Windows Server 2025 to clear any orphaned internal locks, then retry the operation.

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

Troubleshooting Guide: SQL Server Error 1908 — Partition Column Not in Unique Index Key

Why This Error Happens

This error occurs because SQL Server requires that any column used to partition a table must also be part of the key columns of a unique index (including the primary key or unique constraint) created on that table. When a unique index is defined without explicitly including the partitioning column, the engine cannot guarantee uniqueness across partitions, since the same key value could theoretically exist in two different partitions. This is a design constraint, not a permissions or corruption issue, and typically arises when migrating a non-partitioned schema to a partitioned one without updating index definitions.

Step-by-Step Resolution Guide

Step 1: Identify the Conflicting Index and Partitioning Column

  • Review the error message to note the exact column name and index name referenced.
  • Run the following query to inspect the index key columns and the partition function column:
SELECT i.name AS IndexName, c.name AS ColumnName, ic.is_included_column
FROM sys.indexes i
JOIN sys.index_columns ic ON i.object_id = ic.object_id AND i.index_id = ic.index_id
JOIN sys.columns c ON ic.object_id = c.object_id AND ic.column_id = c.column_id
WHERE i.object_id = OBJECT_ID('YourSchema.YourTable');
  • Confirm which column is used in the partition scheme by checking sys.partition_schemes and sys.partition_functions.

Step 2: Modify the Unique Index Definition

  • Drop the existing unique index or constraint that is missing the partitioning column.
  • Recreate it so the partitioning column is explicitly included in the index key (not just as an included column).
DROP INDEX IX_YourIndex ON YourSchema.YourTable;

CREATE UNIQUE INDEX IX_YourIndex
ON YourSchema.YourTable (ExistingKeyColumn, PartitionColumn)
ON YourPartitionScheme(PartitionColumn);
  • If this is a Primary Key constraint, you must drop and recreate the constraint with the partition column included in the key definition.

Step 3: Validate the Partition Scheme Alignment

  • Ensure the index is being created ON the same partition scheme as the base table to maintain alignment.
  • Check that the partition function data type matches the column data type exactly (e.g., INT vs BIGINT mismatches can cause secondary errors).
  • Re-run the deployment or migration script after confirming the index key now logically satisfies uniqueness per partition.

Step 4: Rebuild Dependent Objects

  • If the modified index was referenced by foreign keys or views, rebuild those dependent objects using sp_refreshview or ALTER TABLE ... WITH CHECK CHECK CONSTRAINT.
  • Update any Entity Framework or ORM migration scripts to reflect the new composite key structure to prevent re-triggering the error on future deployments.

Alternative or Verification Steps

  • Verification: Query sys.indexes and sys.partitions to confirm the index status is ONLINE and that the row counts match across all partition boundaries (sys.dm_db_partition_stats).
  • Alternative: If adding the partition column to the unique key is not acceptable for business logic (e.g., it breaks application-level uniqueness assumptions), consider using a non-unique index combined with a CHECK constraint or a filtered index strategy instead, or re-evaluate whether partitioning is necessary for that specific table.

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

Troubleshooting Guide: SQL Server Error 1909 – Duplicate Column Names

Why This Error Happens

Error 1909 occurs when a T-SQL statement—most commonly CREATE TABLE, CREATE VIEW, or a SELECT...INTO operation—attempts to define or return the same column name more than once within a single object. This typically happens when joining multiple tables that share column names without using column aliases, or when a manually scripted DDL statement contains a copy-paste error. SQL Server’s Storage Engine enforces unique column identifiers at the table/view level, so the operation is rejected before any schema changes are committed.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Statement and Column

  • Check the full error message text, as it specifies the exact column name ('%.*ls') causing the conflict.
  • Open SQL Server Management Studio (SSMS) and locate the script or stored procedure referenced in the error output or SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG on Windows Server 2025/Windows 11 default installs).
  • Isolate whether the error originates from a CREATE TABLE statement, a JOIN query, or a SELECT INTO operation.

Step 2: Review and Correct Join-Based Queries

  • If the error stems from a JOIN, inspect the SELECT clause for columns with identical names pulled from different tables (e.g., ID existing in both Orders and Customers).
  • Apply explicit column aliases using the AS keyword, for example: SELECT o.ID AS OrderID, c.ID AS CustomerID FROM Orders o JOIN Customers c ON o.CustomerID = c.ID.
  • Avoid using SELECT * in multi-table joins, as this is the most frequent trigger for this specific error during SELECT...INTO operations.

Step 3: Correct Manual DDL Scripts

  • If the error occurs during a CREATE TABLE or ALTER TABLE statement, manually scan the column definition list for duplicate entries.
  • Rename or remove the redundant column definition directly in the script.
  • Re-run the corrected script using sqlcmd or the SSMS Query Editor to confirm the syntax now parses correctly.

Step 4: Validate Application-Generated Queries

  • If the query is generated dynamically by an application (e.g., via Entity Framework or a custom ORM), enable SQL Profiler or Extended Events to capture the exact generated T-SQL string.
  • Update the application’s data layer code to ensure aliasing logic handles overlapping column names from joined entities before the query reaches the SQL Server 2025 engine.

Alternative or Verification Steps

  • Verify the Fix: Re-execute the corrected script in SSMS; a successful run will return “Command(s) completed successfully” instead of Error 1909.
  • Alternative Check: If using a linked server or distributed query, verify that the remote table schema hasn’t changed recently, as schema drift can sometimes cause unexpected column name collisions in automated ETL scripts.

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

Troubleshooting Guide: SQL Server Error 1910

Why This Error Happens

This error occurs when a table or view definition attempts to exceed SQL Server’s hard-coded limit of 1,024 columns per table (or 1,024 columns per non-indexed view), including columns added via ALTER TABLE statements. This is typically triggered by poorly normalized database schemas, auto-generated tables from ETL tools, or wide “sparse” reporting tables that accumulate columns over time. It can also surface when merging multiple tables via a JOIN into a single view that collectively exceeds the column ceiling.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Object and Column Count

  • Open SQL Server Management Studio (SSMS) and connect to the Database Engine.
  • Run the following query to audit column counts across your database:
  SELECT t.name AS TableName, COUNT(c.column_id) AS ColumnCount
  FROM sys.tables t
  JOIN sys.columns c ON t.object_id = c.object_id
  GROUP BY t.name
  ORDER BY ColumnCount DESC;
  • Note the table or view name mentioned in the error message ‘%.*ls’ from the SQL Server log (located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG on Windows Server 2025).

Step 2: Normalize the Database Schema

  • Split the wide table into multiple related tables using a 1-to-1 or 1-to-many relationship, linked by a common Primary/Foreign Key (e.g., TableName_Part1, TableName_Part2).
  • Move rarely-queried or archival columns into a separate “extension” table to reduce the primary table’s width.
  • If the error occurs during a CREATE VIEW statement, refactor the view to select only necessary columns using explicit column names instead of SELECT * across multiple joined tables.

Step 3: Adjust ETL or Schema Migration Scripts

  • If using SQL Server Integration Services (SSIS) or an ETL tool to auto-generate tables, check the source system for duplicate or auto-incrementing column generation logic that may be inflating column counts.
  • Update the .dtsx package or Python/C# ingestion script to pivot data into rows rather than dynamically creating new columns for every unique data point.

Step 4: Rebuild the Object

  • Drop the problematic object if it was partially created:
  DROP TABLE IF EXISTS dbo.YourTableName;
  • Re-run the corrected CREATE TABLE or CREATE VIEW script with the column count now under the 1,024 limit.

Alternative or Verification Steps

  • Verification: Re-attempt the CREATE TABLE or ALTER TABLE command in SSMS; if successful, confirm the structure using sp_help 'dbo.YourTableName' to ensure no data integrity was lost during normalization.
  • Alternative: If normalization is not immediately feasible, consider storing overflow attributes in a JSON or XML column type instead of discrete columns, as SQL Server 2025 offers enhanced native JSON indexing support for this exact use case.

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

Troubleshooting Guide: SQL Server Error 1904 — Maximum Key Column Limit Exceeded

Why This Error Happens

This error occurs because SQL Server 2025 enforces a hard limit of 16 columns in any single index, primary key, or foreign key column list, and your table definition or ALTER TABLE/CREATE INDEX statement is attempting to exceed that threshold. It is typically caused by overly broad composite key design, auto-generated schema migration scripts, or ORM tools (like Entity Framework) that append columns programmatically without validating against SQL Server’s engine constraints. This is not a bug or corruption issue — it is a strict architectural limitation of the Database Engine that cannot be overridden via configuration.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Statement and Column Count

  • Review the exact T-SQL statement in SQL Server Management Studio (SSMS) that triggered Error 1904.
  • Check the Activity Monitor or query history to find the CREATE INDEX, ALTER TABLE, or CREATE TABLE statement referenced in the error.
  • Count the columns listed in the key — confirm it exceeds 16, the hard-coded engine limit.

Step 2: Redesign the Key or Index Structure

  • Split the oversized key into a smaller clustered/non-clustered index using only the most selective columns (ideally 4–8 columns for performance reasons).
  • For composite primary keys, introduce a surrogate key (e.g., an INT IDENTITY or BIGINT column) instead of chaining many business columns together.
  • Move less-critical columns into INCLUDE() clause of a non-clustered index rather than the key list itself:
  CREATE NONCLUSTERED INDEX IX_Example 
  ON dbo.YourTable (Col1, Col2, Col3) 
  INCLUDE (Col4, Col5, Col6, Col7);

Step 3: Update ORM or Migration Scripts

  • If using Entity Framework, Liquibase, or Flyway, inspect the migration file (commonly under C:\inetpub\wwwroot\YourApp\Migrations\ or your source repo’s /migrations folder) for auto-generated composite keys.
  • Manually edit the migration script to cap key columns at 16 or fewer before re-running dotnet ef database update or your deployment pipeline.

Step 4: Apply the Corrected Schema

  • Drop the failed index/constraint if partially created:
  DROP INDEX IX_Example ON dbo.YourTable;
  • Re-run the corrected CREATE INDEX or ALTER TABLE statement with the reduced column list.

Alternative or Verification Steps

  • Run sp_helpindex 'dbo.YourTable' in SSMS to confirm the new index/key structure is under the 16-column limit and was created successfully.
  • If redesign isn’t immediately feasible, use a computed column (hash of multiple columns via HASHBYTES) as a single surrogate key column to logically represent the combined business logic without violating the limit.

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

Troubleshooting Guide: SQL Server Error 1907 – Index Recreation Mismatch

Why This Error Happens

Error 1907 occurs when you attempt to modify a column or table schema (such as changing a column’s nullability, data type, or size) that is bound to an existing index enforcing a PRIMARY KEY or UNIQUE constraint. SQL Server 2025 attempts to automatically drop and recreate the index to accommodate the schema change, but the new index definition conflicts with the constraint’s original enforcement rules—typically because a column is being altered to allow NULL values while still being part of a PRIMARY KEY or unique constraint. This mismatch halts the DDL operation to prevent data integrity corruption.

Step-by-Step Resolution Guide

Step 1: Identify the Conflicting Index and Constraint

  • Open SQL Server Management Studio (SSMS) 21 or Azure Data Studio connected to your Windows Server 2025 instance.
  • Run the following query to locate the exact constraint name tied to the table in question:
  • SELECT name, type_desc FROM sys.indexes WHERE object_id = OBJECT_ID('YourSchema.YourTable');
  • Note whether the index is enforcing a PK (Primary Key) or UQ (Unique Constraint) type.

Step 2: Drop the Existing Constraint Manually

  • Instead of letting SQL Server attempt an automatic silent recreation, explicitly drop the constraint first.
  • Execute: ALTER TABLE YourSchema.YourTable DROP CONSTRAINT PK_YourTable_ID;
  • Ensure you have ALTER permissions on the schema; verify via SELECT * FROM fn_my_permissions('YourSchema.YourTable', 'OBJECT');

Step 3: Modify the Column Schema

  • Perform the intended alteration (e.g., changing data type or length) now that the index is no longer blocking the operation.
  • Example: ALTER TABLE YourSchema.YourTable ALTER COLUMN ColumnName VARCHAR(100) NOT NULL;
  • Critical: If the column was part of a Primary Key, it must remain NOT NULL; do not attempt to allow nulls on a PK column.

Step 4: Recreate the Index with Correct Definition

  • Manually recreate the constraint to ensure the definition matches current business logic.
  • ALTER TABLE YourSchema.YourTable ADD CONSTRAINT PK_YourTable_ID PRIMARY KEY CLUSTERED (ColumnName);
  • If using a UNIQUE constraint instead, swap the keyword accordingly and verify included columns for composite keys.

Step 5: Clear Cache and Refresh Metadata

  • On Windows Server 2025, restart the SQL Server service via services.msc if the schema change does not reflect immediately in dependent views.
  • Run DBCC FREEPROCCACHE; to ensure no stale execution plans reference the old index structure.

Alternative or Verification Steps

  • Verification: Run sp_helpindex 'YourSchema.YourTable' to confirm the new index structure matches your intended schema design before deploying to production.
  • Alternative: If dropping the constraint is restricted due to foreign key dependencies, use ALTER TABLE ... NOCHECK CONSTRAINT ALL temporarily on child tables, perform the alteration, and then run CHECK CONSTRAINT ALL to re-validate relationships.

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

Troubleshooting Guide: SQL Server Error 1902 — Cannot Create More Than One Clustered Index

Why This Error Happens

This error occurs because a table in SQL Server can physically contain only one clustered index at a time, as the clustered index determines the actual storage order of the data rows on disk. The error is triggered when a CREATE INDEX or CREATE TABLE statement attempts to define a second clustered index on a table (or constraint, such as a PRIMARY KEY, that implicitly creates one) without first removing the existing one. This is frequently caused by migration scripts, ORM frameworks (like Entity Framework), or deployment pipelines that do not check for existing schema objects before attempting to apply new index definitions.

Step-by-Step Resolution Guide

Step 1: Identify the Existing Clustered Index

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and connect to your Windows Server 2025 instance.
  • Run the following query to locate the conflicting index name referenced in the error message:
SELECT i.name AS IndexName, t.name AS TableName 
FROM sys.indexes i 
INNER JOIN sys.tables t ON i.object_id = t.object_id 
WHERE i.type = 1 AND t.name = 'YourTableName';
  • Note the IndexName returned, as you will need this exact name for the next step.

Step 2: Drop the Pre-existing Clustered Index

  • Execute a DROP INDEX statement using the name identified in Step 1.
  • Use the following T-SQL syntax, replacing the placeholders with your specific table and index names:
DROP INDEX [ExistingIndexName] ON [dbo].[YourTableName];
  • If the clustered index is tied to a Primary Key constraint, you must drop the constraint instead using ALTER TABLE [YourTableName] DROP CONSTRAINT [PK_ConstraintName];.

Step 3: Re-run the New Index Creation Script

  • Once the old index is removed, execute your original CREATE CLUSTERED INDEX or deployment script again.
  • Ensure the script logic for future deployments includes a check: IF EXISTS (SELECT * FROM sys.indexes WHERE name = 'IndexName') DROP INDEX... to prevent recurrence.

Step 4: Restart the SQL Server Service (If Cache Issues Persist)

  • If the error persists due to a stale query plan cache on Windows Server 2025, open the Services app (services.msc).
  • Locate SQL Server (MSSQLSERVER), right-click, and select Restart to clear the execution plan cache.

Alternative or Verification Steps

  • Verify the Fix: Run SELECT name, type_desc FROM sys.indexes WHERE object_id = OBJECT_ID('YourTableName'); to confirm only one row shows type_desc as CLUSTERED.
  • Alternative: If you need the data organized by the new key but cannot drop the old index due to dependencies, consider creating the new index as a Non-Clustered index instead to avoid altering the physical table structure.

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

Troubleshooting Guide: SQL Server Error 1901 — Imprecise Key Column in Indexed View

Why This Error Happens

This error occurs because SQL Server 2025 requires all key columns in an indexed view to be deterministic and “precise,” meaning they must consistently return the same result given the same input, without relying on floating-point imprecision. Columns using data types like float or real, or expressions/aggregates performed on them, are inherently imprecise because floating-point arithmetic can yield slightly different results depending on processor architecture or query execution plans. SQL Server blocks the index creation to prevent data corruption or inconsistent query results that could arise from indexing a value that isn’t guaranteed to be identical every time it’s computed.

Step-by-Step Resolution Guide

Step 1: Identify the Imprecise Column

  • Review the full error message to identify the exact column name flagged in the view definition.
  • Run the following query to inspect the view’s schema and data types:
sp_help 'YourViewName';
  • Look specifically for columns defined as float or real, or any computed columns that perform mathematical operations on these types (e.g., division, multiplication, or aggregate functions like SUM()/AVG()).

Step 2: Modify the View to Use Precise Data Types

  • Alter the underlying view definition to replace float or real columns with precise, deterministic data types such as decimal, numeric, int, or bigint.
  • Example fix using ALTER VIEW:
ALTER VIEW dbo.YourViewName
WITH SCHEMABINDING
AS
SELECT
    CAST(SomeColumn AS DECIMAL(18,4)) AS PreciseColumn,
    OtherColumn
FROM dbo.YourBaseTable;
  • Ensure WITH SCHEMABINDING remains intact, as this is a mandatory requirement for indexed views.

Step 3: Recreate the Unique Clustered Index

  • Once the view has been altered to use precise data types, attempt to create the index again via SQL Server Management Studio (SSMS) or a T-SQL script:
CREATE UNIQUE CLUSTERED INDEX IDX_YourView_Precise
ON dbo.YourViewName (PreciseColumn);
  • If using SSMS on Windows 11/Server 2025, ensure you are connected with a login that has ALTER permissions on the schema, as permission issues can sometimes surface alongside schema errors.

Step 4: Check Computed Columns and Aggregates

  • If the imprecise column results from a computed expression (rather than a raw column), move the floating-point math logic into the application layer or a precise computed column using PERSISTED with explicit casting.
  • Avoid using AVG(), VAR(), or STDEV() directly on float columns within the indexed view; replace with decimal-based calculations.

Alternative or Verification Steps

  • Verify the Fix: After recreating the index, run DBCC CHECKCONSTRAINTS and sys.indexes queries to confirm the index status is is_disabled = 0 and valid.
  • Alternative Workaround: If changing the data type is not feasible due to application dependencies, remove the SCHEMABINDING requirement for a standard (non-indexed) view instead, sacrificing the performance benefits of an indexed view for data type flexibility.

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

Troubleshooting Guide: Error 1900 – Filtered Clustered Index Not Supported in SQL Server 2025

Why This Error Happens

SQL Server’s Database Engine does not permit a WHERE predicate clause to be applied to a clustered index, because the clustered index defines the physical storage order of the entire table and must therefore contain every row without exception. Error 1900 is raised during T-SQL parsing when the CREATE INDEX statement combines the CLUSTERED keyword with a WHERE clause, which is only valid for nonclustered indexes. This is a syntax/design limitation by architecture, not a configuration, permissions, or corruption issue.

Step-by-Step Resolution Guide

Step 1: Identify the Offending T-SQL Statement

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio connected to your SQL Server 2025 instance.
  • Locate the script containing CREATE CLUSTERED INDEX ... WHERE ... syntax.
  • Confirm the error in the Messages pane references Error 1900 and mentions “filtered clustered indexes are not supported.”

Step 2: Remove the Predicate or Change the Index Type

  • If filtering is required, remove the CLUSTERED keyword and create the index as NONCLUSTERED instead.
  • Example corrected syntax:
  CREATE NONCLUSTERED INDEX IX_Orders_Filtered
  ON dbo.Orders (OrderDate)
  WHERE OrderStatus = 'Active';
  • If the clustered index is mandatory (e.g., for physical sort order), remove the WHERE clause entirely:
  CREATE CLUSTERED INDEX IX_Orders_Clustered
  ON dbo.Orders (OrderDate);

Step 3: Redesign the Indexing Strategy if Both Are Needed

  • Keep the clustered index unfiltered to maintain full table coverage (e.g., on the primary key or a logical sort column).
  • Add a separate filtered nonclustered index for the specific subset of rows you need to optimize queries against.
  • Store this design in your schema change scripts located under C:\SQLScripts\Indexes\ (or your source-controlled repository) for consistency across environments.

Step 4: Re-deploy and Validate the Schema Change

  • Re-run the corrected script against the target database in SSMS.
  • Check sys.indexes and sys.indexes.has_filter to confirm the nonclustered filtered index was created correctly:
  SELECT name, type_desc, has_filter, filter_definition
  FROM sys.indexes
  WHERE object_id = OBJECT_ID('dbo.Orders');

Alternative or Verification Steps

  • Run SELECT * FROM sys.indexes WHERE has_filter = 1; to confirm the filtered index is nonclustered and the predicate is correctly applied.
  • If you must guarantee physical row ordering and filtering, consider using an indexed view or partitioning the table instead, since neither clustered indexes nor the underlying heap/B-tree structure support row-level filtering by design.

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

Troubleshooting Guide: SQL Server Error 1860 — “Task Has Been Aborted”

Why This Error Happens

Error 1860 in SQL Server 2025 typically occurs when a background task—such as a scheduled job, maintenance plan, or replication process—is forcibly terminated due to resource contention, a broken dependency chain, or an unexpected service interruption. This often stems from insufficient worker threads in the SQL Server scheduler, a deadlock that the system resolves by killing the task, or corrupted job metadata in the msdb database. On Windows Server 2025 / Windows 11, this can also be triggered by abrupt service restarts or Windows Update interrupting the SQL Server Agent service mid-execution.

Step-by-Step Resolution Guide

Step 1: Verify SQL Server Agent and Service Health

  • Open SQL Server Configuration Manager and confirm the SQL Server Agent service is running without interruption.
  • Check Windows Event Viewer under Applications and Services Logs > MSSQLSERVER for correlating shutdown or restart events.
  • Run EXEC msdb.dbo.sp_help_job to review job history and confirm whether the abort correlates with a specific job execution.

Step 2: Inspect and Increase Worker Thread Allocation

  • Open SQL Server Management Studio (SSMS) and run:
  EXEC sp_configure 'max worker threads';
  • If the value is too low relative to active connections, increase it:
  EXEC sp_configure 'max worker threads', 0; -- 0 allows SQL Server to auto-manage
  RECONFIGURE;
  • Restart the SQL Server service for changes to take effect via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 3: Repair Corrupted Job Metadata in msdb

  • Run a consistency check against the msdb database:
  DBCC CHECKDB ('msdb') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is found, restore msdb from a known good backup or recreate the affected job using SQL Server Agent > Jobs > New Job.

Step 4: Check for Deadlocks or Blocking Sessions

  • Query active blocking sessions:
  SELECT * FROM sys.dm_exec_requests WHERE blocking_session_id <> 0;
  • Enable the Deadlock Graph via Extended Events to capture future occurrences:
  CREATE EVENT SESSION DeadlockMonitor ON SERVER
  ADD EVENT sqlserver.xml_deadlock_report
  ADD TARGET package0.event_file(SET filename='DeadlockMonitor.xel');

Step 5: Update SQL Server 2025 Cumulative Patches

  • Navigate to Windows Update or the Microsoft Update Catalog and confirm the latest Cumulative Update (CU) for SQL Server 2025 is installed.
  • Apply the patch and restart the server during a scheduled maintenance window.

Alternative or Verification Steps

  • Re-run the previously failed job manually via SQL Server Agent > Jobs > Start Job at Step and confirm it completes without triggering Error 1860.
  • If the issue persists, enable Verbose Logging on SQL Server Agent (SQLAGENT.OUT) to capture a more detailed stack trace for deeper analysis with Microsoft Support.

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

Troubleshooting Guide: Error 1859 – Create Database Not Allowed in Model Database Context

Why This Error Happens

This error occurs when a session’s current database context is set to model while attempting to execute a CREATE DATABASE statement. SQL Server reserves the model database as a template for all new databases, and it enforces a restriction preventing CREATE DATABASE commands from running while model is the active context, since doing so could create ambiguity in how the new database inherits its template structure. This typically happens when a login’s default database is misconfigured to model, or when a script explicitly runs USE model before issuing a database creation command.

Step-by-Step Resolution Guide

Step 1: Identify the Current Session Context

  • Open a new query window in SQL Server Management Studio (SSMS) connected to your Microsoft SQL Server 2025 instance.
  • Run SELECT DB_NAME(); to confirm whether the session context is currently set to model.
  • Check the top-left dropdown in SSMS toolbar to visually confirm the active database for the connection.

Step 2: Switch Context Using the USE Statement

  • Before executing your CREATE DATABASE command, explicitly switch context to a safe system database such as master.
  • Run the following T-SQL command:
USE master;
GO
CREATE DATABASE YourNewDatabaseName;
GO
  • Ensure there are no preceding USE model; statements left in your script from copy-pasted templates or automation jobs.

Step 3: Check and Correct the Login’s Default Database

  • Navigate to SSMS > Security > Logins, right-click the relevant login, and select Properties.
  • On the General page, check the Default database dropdown; if it is set to model, change it to master to prevent this issue on future connections.
  • Alternatively, run this T-SQL command to fix it via script:
ALTER LOGIN [YourLoginName] WITH DEFAULT_DATABASE = master;

Step 4: Audit Automation Scripts and Connection Strings

  • Review any SSIS packages, PowerShell scripts, or application connection strings that may hardcode model as the initial catalog.
  • Update the Initial Catalog or Database parameter in connection strings to master or a neutral database.
  • Save and redeploy the corrected scripts to your Windows Server 2025 task scheduler or SQL Agent jobs.

Alternative or Verification Steps

  • To verify the fix, run CREATE DATABASE TestDB; immediately after USE master; and confirm it completes without Error 1859, then clean up with DROP DATABASE TestDB;.
  • If the error persists despite switching context, restart the SQL Server service via Services.msc on Windows Server 2025 to clear any cached session states, then retry the connection.

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

Troubleshooting Guide: SQL Server Error 1858 – “Could Not Create Snapshot Database Because User Database Is Still In Recovery”

Why This Error Happens

This error occurs when SQL Server attempts to create a database snapshot while the source database has not yet completed its recovery process, meaning the redo/undo phases of crash recovery are still active. It can also surface if the source database is in a SUSPECT, RESTORING, or otherwise unstable state due to improper shutdown, long-running transactions being rolled back, or underlying storage/IO latency on Windows Server 2025. Since a snapshot requires a transactionally consistent and fully recovered source database, SQL Server blocks the operation until recovery fully completes.

Step-by-Step Resolution Guide

Step 1: Verify the Source Database Recovery State

  • Open SQL Server Management Studio (SSMS) or run a query against sys.databases to check the state_desc column for the source database.
  • Execute: SELECT name, state_desc FROM sys.databases WHERE name = 'YourDatabaseName';
  • If the state shows RECOVERY_PENDING, SUSPECT, or RESTORING, do not attempt to create the snapshot yet — proceed to Step 2.

Step 2: Allow Recovery to Complete or Force Resolution

  • Check the SQL Server Error Log (located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG by default) for ongoing redo/undo progress messages.
  • If recovery appears stalled, restart the SQL Server service via Services.msc or PowerShell: Restart-Service -Name 'MSSQLSERVER'.
  • For a database stuck in SUSPECT mode, run: ALTER DATABASE YourDatabaseName SET EMERGENCY; ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE; DBCC CHECKDB (YourDatabaseName, REPAIR_ALLOW_DATA_LOSS);
  • Once checks complete, reset the database: ALTER DATABASE YourDatabaseName SET MULTI_USER;

Step 3: Check Storage and I/O Health on Windows Server 2025

  • Open Event Viewer (eventvwr.msc) and review the System and Application logs for Disk or I/O warnings correlating with the SQL Server timestamp.
  • Confirm underlying storage (SAN/NAS/local SSD) is not experiencing latency spikes using Performance Monitor counters such as Avg. Disk sec/Read and Avg. Disk sec/Write.
  • If storage issues are found, resolve hardware/driver conflicts before retrying recovery.

Step 4: Retry Snapshot Creation

  • Once state_desc returns ONLINE, re-issue the snapshot creation command:
  • CREATE DATABASE YourDatabaseName_Snapshot ON (NAME = YourDatabaseName, FILENAME = 'D:\SQLSnapshots\YourDatabaseName_Snapshot.ss') AS SNAPSHOT OF YourDatabaseName;
  • Monitor the command execution for successful completion without Error 1858.

Alternative or Verification Steps

  • Run SELECT name, state_desc FROM sys.databases; again post-fix to confirm the source database shows ONLINE before attempting any snapshot creation.
  • If the issue persists after recovery completes, restore the source database from a known-good backup to a new instance and recreate the snapshot there instead.

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

Troubleshooting Guide: SQL Server Error 1857 – Database File Already In Use

Why This Error Happens

Error 1857 occurs when SQL Server attempts to attach a database file (.mdf/.ldf/.ndf) that is currently held open by another process, another instance of SQL Server, or an existing database on the same instance. This typically happens when a previous attach operation failed silently and left the file handle locked, when the database is already attached under a different name, or when an external backup/antivirus tool has an active lock on the file. In some cases, this also occurs when a file is stored on a network share or cloud-synced folder (like OneDrive on Windows 11) that maintains its own lock separate from the OS file system.

Step-by-Step Resolution Guide

Step 1: Identify the Process or Database Holding the File Lock

  • Open SQL Server Management Studio (SSMS) and run the following query to check if the file is already attached to a different database name:
  • SELECT name, physical_name FROM sys.master_files WHERE physical_name LIKE '%YourFileName%';
  • If no result is returned, use Resource Monitor (resmon.exe) on Windows Server 2025 / Windows 11 and search the “CPU” tab under “Associated Handles” for the .mdf or .ldf file name to identify the locking process (e.g., sqlservr.exe, antivirus, or backup agent).

Step 2: Release the Lock Safely

  • If the file is locked by a stale SQL Server session, restart the specific SQL Server instance service via SQL Server Configuration Manager rather than killing the process directly.
  • If an antivirus or backup tool (e.g., Windows Defender) is holding the handle, add an exclusion for the SQL Server data directory, typically located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\.
  • If the file resides on a mapped network drive, ensure the share is not using opportunistic locking (oplocks) by verifying SMB settings on the hosting server.

Step 3: Detach or Take the Conflicting Database Offline

  • If the query in Step 1 confirms the file belongs to an existing attached database, do not attempt a new attach; instead, use the existing database or run:
  • EXEC sp_detach_db 'ExistingDatabaseName';
  • If the database is corrupted or you need exclusive access, right-click the database in SSMS Object Explorer, select Tasks > Take Offline, then retry the attach operation.

Step 4: Retry the Attach Operation with a Copy

  • If the lock persists due to filesystem caching issues on Windows Server 2025, copy the .mdf and .ldf files to a new local directory (e.g., D:\SQLData\Recovery\) to strip any residual locks or alternate data stream locks.
  • Run the attach command again pointing to the new file path:
  • CREATE DATABASE YourDB ON (FILENAME = 'D:\SQLData\Recovery\YourDB.mdf') FOR ATTACH;

Alternative or Verification Steps

  • Verify the Fix: Run sp_helpdb 'YourDatabaseName' in SSMS to confirm the database status shows “ONLINE” and the file paths match the intended location without errors.
  • Alternative Solution: If the error persists after a server reboot, use the Handle.exe utility from Sysinternals to force-identify and close the specific lingering file handle without restarting the entire SQL Server service.

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

Troubleshooting Guide: SQL Server Error 1856 – Database Already Attached

Why This Error Happens

Error 1856 occurs when SQL Server detects that the database name you are trying to attach is already registered in the instance’s metadata, pointing to a different physical file path. This typically happens when a database was previously attached or restored under the same logical name, or when a leftover entry exists in sys.databases after an incomplete detach operation. It can also occur if two different .mdf files were copied or renamed but SQL Server still references the original file location internally.

Step-by-Step Resolution Guide

Step 1: Verify the Current Database Attachment Status

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Run the following query to check if the database name is already in use:
  SELECT name, database_id, state_desc, physical_name 
  FROM sys.master_files 
  WHERE name = 'YourDatabaseName';
  • Note the physical_name path returned, as this is the file currently locked to that database name.

Step 2: Properly Detach the Existing Database

  • If the database is already attached and you want to replace it with a new file, detach it cleanly first:
  USE [master];
  GO
  ALTER DATABASE [YourDatabaseName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  GO
  EXEC sp_detach_db 'YourDatabaseName';
  GO
  • Confirm no active connections or orphaned sessions are holding a lock on the database using sp_who2.

Step 3: Rename or Choose a Unique Database Name

  • If you intend to keep both databases (old and new) active simultaneously, attach the new .mdf file under a different logical name:
  CREATE DATABASE [YourDatabaseName_New] 
  ON (FILENAME = 'C:\SQLData\NewFile.mdf') 
  FOR ATTACH;
  • Update the physical path to reflect the correct location on your Windows Server 2025 or Windows 11 machine (e.g., C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).

Step 4: Clear Orphaned Metadata (If Detach Fails)

  • If sp_detach_db fails because the database state is corrupted or inaccessible, manually remove the entry using the Dedicated Administrator Connection (DAC):
  DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS;
  DROP DATABASE [YourDatabaseName];
  • Restart the SQL Server (MSSQLSERVER) service via services.msc to clear any cached file handles before retrying the attach command.

Alternative or Verification Steps

  • To verify the fix, re-run the CREATE DATABASE ... FOR ATTACH command; if successful, query sys.databases to confirm the state_desc shows ONLINE with the correct physical_name.
  • As an alternative, if the GUI-based attach in SSMS continues to throw Error 1856, restart the SQL Server service to flush the metadata cache, then attempt the attach operation via the command line using sqlcmd -S localhost -Q "CREATE DATABASE...".

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

Troubleshooting Guide: SQL Server Error 1855 – Sysfiles1 System Table Corruption

Why This Error Happens

Error 1855 occurs when the internal system table sysfiles1, which tracks database file allocation metadata, becomes corrupted due to abrupt shutdowns, storage subsystem failures, or disk I/O errors during a write operation. This can also result from bad sectors on the underlying storage volume, antivirus software interfering with .mdf/.ldf files, or a forced termination of the SQL Server service while a checkpoint operation was in progress. In some cases, running Windows Server 2025 with outdated storage drivers or filter drivers (e.g., backup agents) hooked into the I/O stack can also trigger this corruption.

Step-by-Step Resolution Guide

Step 1: Isolate the Database and Stop Active Connections

  • Open SQL Server Management Studio (SSMS) and identify the affected database reporting Error 1855.
  • Run the following to set the database to single-user mode and kick off active sessions:
  ALTER DATABASE [YourDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • Ensure no external applications or SQL Agent jobs are actively writing to the database files during this process.

Step 2: Run DBCC CHECKDB to Assess Corruption Scope

  • Execute a full consistency check to determine if corruption is isolated to sysfiles1 or spans other system tables:
  DBCC CHECKDB ('YourDB') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for references to sysfiles1, allocation unit IDs, or page-level errors.
  • If corruption is confirmed, note the minimal repair level suggested in the DBCC output (usually REPAIR_ALLOW_DATA_LOSS).

Step 3: Restore from the Last Known Good Backup

  • Navigate to your backup repository (commonly D:\SQLBackups\ on Windows Server 2025 deployments).
  • Restore the database using the most recent full backup plus differential/log backups:
  RESTORE DATABASE [YourDB] FROM DISK = 'D:\SQLBackups\YourDB_Full.bak' WITH NORECOVERY;
  RESTORE LOG [YourDB] FROM DISK = 'D:\SQLBackups\YourDB_Log.trn' WITH RECOVERY;
  • This avoids relying on REPAIR_ALLOW_DATA_LOSS, which can permanently remove corrupted pages and data.

Step 4: Rebuild System Files if Restore Is Not an Option

  • If no valid backup exists, use the SQL Server 2025 Setup (setup.exe) with the /ACTION=REBUILDDATABASE parameter to rebuild the master database and system tables.
  • Run from an elevated Command Prompt:
  setup.exe /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=MSSQLSERVER /SQLSYSADMINACCOUNTS=Administrators /SAPWD=<StrongPassword>
  • Afterward, reattach user databases using sp_attach_db or restore them individually.

Step 5: Re-enable Multi-User Access and Monitor

  • Once the database is repaired or restored, revert it back to multi-user mode:
  ALTER DATABASE [YourDB] SET MULTI_USER;
  • Monitor the Windows Event Viewer (Application and System logs) for recurring disk-related warnings (Event ID 153 or 55) that may indicate ongoing hardware issues.

Alternative or Verification Steps

  • Run DBCC CHECKDB ('YourDB') WITH NO_INFOMSGS; once more after remediation to confirm zero allocation or consistency errors are returned.
  • If corruption recurs shortly after resolution, run chkdsk /f /r on the volume hosting your .mdf/.ldf files and update storage/RAID controller drivers via Windows Update or the OEM support site to rule out a hardware-level root cause.

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

Troubleshooting Guide: SQL Server Error 1854

Why This Error Happens

This error occurs when SQL Server attempts to move or restore a database and combine the original logical file name with a new, longer file path, but the resulting fully-qualified path exceeds Windows’ internal path length limitations. This is typically triggered during database restore operations with MOVE clauses, attach operations, or file relocation where the destination directory structure is deeply nested. The issue is purely a string-length/path-construction limitation and is not related to permissions or disk corruption.

Step-by-Step Resolution Guide

Step 1: Identify the Problematic File Path

  • Review the full error message and note the logical file name referenced in the %.*ls placeholders.
  • Run RESTORE FILELISTONLY FROM DISK = 'C:\Backups\YourBackup.bak'; to list all logical and physical file names in the backup.
  • Calculate the combined length of your target directory path plus the original logical file name and extension — Windows generally supports up to 260 characters unless long path support is explicitly enabled.

Step 2: Shorten the Destination Path or Rename the Logical File

  • Choose a shorter destination directory, such as D:\SQLData\ instead of a deeply nested path like D:\SQLServer\Instances\Production\Databases\Data\.
  • When restoring, explicitly specify a new, shorter physical file name using the MOVE clause:
  RESTORE DATABASE YourDB
  FROM DISK = 'C:\Backups\YourBackup.bak'
  WITH MOVE 'YourDB_Data' TO 'D:\SQLData\YourDB.mdf',
  MOVE 'YourDB_Log' TO 'D:\SQLLogs\YourDB.ldf';
  • Avoid relying on SQL Server to auto-generate the new file name based on the original logical name if that name is excessively long.

Step 3: Enable Long Path Support (If Shortening Is Not Feasible)

  • On Windows Server 2025 / Windows 11, open the Local Group Policy Editor (gpedit.msc).
  • Navigate to Computer Configuration > Administrative Templates > System > Filesystem and enable “Enable Win32 long paths.”
  • Alternatively, set the registry key via PowerShell:
  Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1
  • Restart the SQL Server service for the policy change to take effect, since SQL Server must recognize the updated filesystem behavior at startup.

Step 4: Retry the Restore or Attach Operation

  • Re-run the original RESTORE DATABASE or sp_attach_db command with the corrected, shortened paths.
  • Monitor the SQL Server Error Log (Management > SQL Server Logs in SSMS) for confirmation that the operation completed without raising Error 1854 again.

Alternative or Verification Steps

  • Verify success by querying sys.master_files or running RESTORE FILELISTONLY again to confirm the new physical file paths match your intended shortened locations.
  • If the error persists even after shortening paths, manually detach the database, rename files using Windows Explorer or Rename-Item in PowerShell, and reattach using CREATE DATABASE ... FOR ATTACH with explicit, verified short paths.

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

Troubleshooting Guide: Error 1853 — Logical Database File Cannot Be Found

Why This Error Happens

This error occurs when SQL Server’s system catalog references a logical file name during a RESTORE, ALTER DATABASE, or attach operation, but the physical file path stored or supplied does not match an actual file location on disk. Common root causes include the database being moved/copied without updating file paths, a backup being restored to a server where the original folder structure doesn’t exist, or the SQL Server service account lacking read/write permissions on the target directory. It can also occur due to a typo in the MOVE clause of a RESTORE DATABASE command or a missing drive/mount point on Windows Server 2025.

Step-by-Step Resolution Guide

Step 1: Verify the Logical File Names and Current Paths

  • Run RESTORE FILELISTONLY FROM DISK = 'C:\Backups\YourBackup.bak' to list the logical and physical file names stored in the backup.
  • Compare the LogicalName and PhysicalName columns against what your command is attempting to use.
  • Note any discrepancies in drive letters (e.g., D:\ vs C:\) between the backup source and the Windows Server 2025 target machine.

Step 2: Correct the File Path Using the MOVE Clause

  • Re-run the restore command explicitly mapping each logical file to a valid physical path:
RESTORE DATABASE [YourDB]
FROM DISK = 'C:\Backups\YourBackup.bak'
WITH MOVE 'YourDB_Data' TO 'C:\SQLData\YourDB.mdf',
MOVE 'YourDB_Log' TO 'C:\SQLLogs\YourDB_log.ldf';
  • Ensure the target folders (e.g., C:\SQLData\ and C:\SQLLogs\) exist before executing the command; SQL Server 2025 will not auto-create missing directories.

Step 3: Validate Folder Existence and NTFS Permissions

  • Open File Explorer or PowerShell on Windows Server 2025/Windows 11 and confirm the target directories physically exist.
  • Grant the SQL Server service account (e.g., NT Service\MSSQLSERVER) Modify and Read & Execute permissions on the folder via right-click → Properties → Security tab.
  • If using a named instance, confirm the correct service account is referenced in services.msc under “Log On As.”

Step 4: Check for Detached/Orphaned Files or Mount Point Issues

  • If attaching a database manually via sp_attach_db or CREATE DATABASE ... FOR ATTACH, confirm both .mdf and .ldf files are physically present in the specified path.
  • Verify any mapped network drives or mount points referenced in the file path are active and accessible to the SQL Server service (service accounts often cannot see mapped drives created under a user session).

Alternative or Verification Steps

  • After applying fixes, run ALTER DATABASE [YourDB] SET ONLINE; and check sys.master_files to confirm the physical_name column reflects the corrected path.
  • If the issue persists, use SQL Server Configuration Manager to restart the SQL Server service after granting permissions, as cached file handles may not refresh until a service restart.