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

Troubleshooting Guide: SQL Server Error 3904 — “Cannot unsplit logical page %S_PGID in object”

Why This Error Happens

Error 3904 occurs when SQL Server’s recovery process attempts to merge (unsplit) a page that was split during a logical operation, but the page chain metadata is inconsistent or corrupted. This typically happens due to physical database corruption caused by faulty storage hardware, improper shutdowns, or a bug in page-split logging during a transaction rollback. It frequently surfaces during database recovery, DBCC CHECKDB operations, or when restoring from a backup that was taken while the page structure was in an inconsistent state.

Step-by-Step Resolution Guide

Step 1: Run DBCC CHECKDB to Assess the Damage

  • Open SQL Server Management Studio (SSMS) or sqlcmd on your Windows Server 2025 / Windows 11 instance.
  • Execute: DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for the specific page ID and object ID referenced in the error (%S_PGID and object name).
  • Note whether the error is isolated to one index/table or widespread across the database.

Step 2: Check Underlying Storage and Event Logs

  • Open Event Viewer (eventvwr.msc) and inspect the System and Application logs for disk, controller, or I/O subsystem errors around the time the corruption occurred.
  • Run chkdsk C:\ /f /r (adjust drive letter to your SQL data volume) during a maintenance window to rule out underlying disk corruption.
  • Verify storage drivers and firmware are up to date, especially on Windows Server 2025 with newer NVMe/SAN controllers.

Step 3: Restore from a Known Good Backup

  • Navigate to your backup directory, typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\.
  • Restore the last clean full backup, followed by applicable differential/log backups:
  • RESTORE DATABASE YourDatabaseName FROM DISK = 'C:\Backups\YourDatabaseName.bak' WITH NORECOVERY;
  • RESTORE LOG YourDatabaseName FROM DISK = 'C:\Backups\YourDatabaseName_log.trn' WITH RECOVERY;
  • Confirm the restored database no longer throws Error 3904 on the affected page.

Step 4: Repair with DBCC CHECKDB (If No Clean Backup Exists)

  • Put the database in single-user mode: ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • Run the repair option: DBCC CHECKDB ('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS);
  • Note that this option can result in data loss for the affected pages, so only use it as a last resort.
  • Set the database back to multi-user mode: ALTER DATABASE YourDatabaseName SET MULTI_USER;

Step 5: Rebuild Affected Indexes

  • Once the page-level corruption is resolved, rebuild indexes on the affected object to ensure structural integrity:
  • ALTER INDEX ALL ON YourTableName REBUILD;
  • This prevents recurrence of page-split issues tied to fragmented or stale index structures.

Alternative or Verification Steps

  • Re-run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; after remediation to confirm zero allocation or consistency errors are returned.
  • If corruption recurs frequently, consider engaging Microsoft Customer Support Services (CSS) for root-cause hardware diagnostics, and implement redundant storage (RAID) or move the database files to a more reliable disk subsystem.