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

Troubleshooting Guide: Error 3458 – Recovery Cannot Scan Database for Dropped Allocation Units

Why This Error Happens

Error 3458 occurs when SQL Server’s recovery process attempts to clean up deferred drop transactions (dropped allocation units) during database startup or recovery, but encounters an unexpected obstacle such as page-level corruption, a damaged transaction log, or an I/O failure on the underlying storage. This is often triggered by an improper shutdown, disk subsystem errors, or filesystem-level corruption affecting the data or log files. In some cases, it stems from insufficient disk space preventing the deferred drop cleanup worker from completing its scan.

Step-by-Step Resolution Guide

Step 1: Check SQL Server Error Log and System Event Viewer

  • Open SQL Server Management Studio (SSMS) or navigate to the log directory, typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Look for accompanying I/O errors (Error 823, 824, or 825) that often precede Error 3458.
  • Cross-reference with Windows Event Viewer under Windows Logs > System for disk or storage controller warnings.

Step 2: Verify Disk Space and Storage Health

  • Confirm the data and log file drives have at least 20% free space; deferred drop operations require workspace to complete cleanup.
  • Run chkdsk /f /r on the affected volume (requires a reboot if the volume hosts system/database files) to identify and repair filesystem-level corruption.
  • Check physical disk health via Server Manager or Get-PhysicalDisk | Get-StorageReliabilityCounter in PowerShell for predictive failure indicators.

Step 3: Run DBCC CHECKDB to Assess Corruption Scope

  • Execute DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to identify the extent of allocation unit corruption.
  • Review the output for specific object IDs and page IDs tied to the orphaned allocation units.
  • If corruption is confirmed, note whether it’s isolated to non-clustered indexes (safer to repair) or clustered/heap structures (higher risk).

Step 4: Restore From a Known Good Backup

  • If corruption is extensive, restore the database from the most recent clean full backup plus transaction log backups using RESTORE DATABASE YourDatabaseName FROM DISK = 'E:\Backups\YourDatabase.bak' WITH NORECOVERY, followed by log restores.
  • This bypasses the problematic recovery cleanup phase entirely by replacing the damaged database files.

Step 5: Apply Repair as a Last Resort

  • Set the database to single-user emergency mode: ALTER DATABASE YourDatabaseName SET EMERGENCY;
  • Run DBCC CHECKDB('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS; only after exhausting backup options, as this may result in data loss for affected allocation units.
  • Return the database to multi-user mode once repair completes: ALTER DATABASE YourDatabaseName SET MULTI_USER;

Alternative or Verification Steps

  • After applying a fix, restart the SQL Server service and monitor the ERRORLOG to confirm the database completes recovery without re-triggering Error 3458, then re-run DBCC CHECKDB to validate zero allocation errors remain.
  • If the issue persists after repair, consider detaching the database, moving the physical .mdf/.ldf files to healthy storage, and reattaching via CREATE DATABASE YourDatabaseName ON (FILENAME = '...') FOR ATTACH to rule out hardware-level storage degradation.

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

Why This Error Happens

Error 3456 occurs when SQL Server 2025’s recovery process encounters a log record it cannot apply (redo) during crash recovery or restore operations, typically because the transaction log has become corrupted, truncated unexpectedly, or is inconsistent with the data file (MDF/NDF). This often stems from improper shutdowns, storage subsystem failures (disk errors, SAN misconfiguration), antivirus interference with database files, or hardware-level I/O corruption that silently damages log pages before they are flushed to disk. It can also surface after a failed failover in an Always On Availability Group when the secondary replica’s log does not match the primary’s LSN sequence.

Step-by-Step Resolution Guide

Step 1: Verify the Scope of Corruption

  • Check the SQL Server Error Log located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for the full error context and surrounding messages.
  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS to confirm the extent of page-level or log-level corruption.
  • Check Windows Event Viewer under Windows Logs > System for underlying disk or storage controller errors (Event IDs 7, 9, 11, 51).

Step 2: Attempt Recovery via Backup Restoration

  • If a corrupted log prevents the database from coming online, restore the most recent full backup followed by subsequent differential and transaction log backups:
  • RESTORE DATABASE YourDatabaseName FROM DISK = 'D:\Backups\YourDB_Full.bak' WITH NORECOVERY
  • RESTORE LOG YourDatabaseName FROM DISK = 'D:\Backups\YourDB_Log1.trn' WITH RECOVERY
  • Ensure backup files are not stored on the same physical volume that experienced the storage failure.

Step 3: Force Emergency Mode Repair (If No Valid Backup Exists)

  • Set the database to emergency mode to bypass the normal recovery process:
  • ALTER DATABASE YourDatabaseName SET EMERGENCY
  • Run DBCC CHECKDB('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS in single-user mode:
  • ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE
  • Return the database to multi-user mode once repair completes: ALTER DATABASE YourDatabaseName SET MULTI_USER

Step 4: Rule Out Storage and Antivirus Interference

  • Confirm that antivirus or endpoint protection software excludes the .mdf, .ndf, and .ldf file paths (commonly under D:\SQLData\ and D:\SQLLogs\ on Windows Server 2025).
  • Run chkdsk D: /f /r during a maintenance window to identify and repair underlying disk sector issues.
  • Update storage controller and HBA drivers to the latest version certified for Windows Server 2025.

Alternative or Verification Steps

  • After recovery, run DBCC CHECKDB again with no repair options to confirm zero allocation or consistency errors, and verify the database state shows ONLINE in sys.databases.
  • If repair with data loss is unacceptable, engage Microsoft Customer Support Services with the ERRORLOG and a recent DBCC CHECKDB output to explore advanced page-restore or log-shipping recovery options from a healthy secondary replica.

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

Troubleshooting Guide: SQL Server Error 3454 — Recovery Checkpoint Message

Why This Error Happens

Error 3454 is not actually an error — it is an informational message logged by the SQL Server Database Engine during the recovery process, indicating that a checkpoint operation is being written to the specified database. This message typically appears in the SQL Server Error Log when a database starts up, fails over in an Always On Availability Group, or recovers after an unexpected shutdown, as part of normal crash recovery or standard checkpoint behavior. It becomes a point of concern for administrators primarily when it appears excessively or alongside actual errors, which may indicate underlying issues such as disk I/O latency, improper shutdowns, or misconfigured recovery intervals rather than the message itself being faulty.

Step-by-Step Resolution Guide

Step 1: Confirm the Message is Informational and Not Masking a Real Error

  • Open the SQL Server Error Log via SQL Server Management Studio (SSMS) under Management > SQL Server Logs.
  • Search for Error 3454 and check the surrounding log entries for Severity Level — this message is logged as a Level 10 (informational) message, not a Level 16+ severe error.
  • Confirm there are no associated errors like 9001 (Log corrupt), 823, or 824 (I/O errors) near the same timestamp.

Step 2: Review the Recovery Interval and Checkpoint Configuration

  • Run the following T-SQL query to check the current recovery interval setting:
EXEC sp_configure 'recovery interval (min)';
  • If the value is set to 0 (automatic), SQL Server dynamically determines checkpoint frequency based on workload; consider manually tuning this if checkpoints are too frequent.
  • Adjust using:
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'recovery interval (min)', 5;
RECONFIGURE;

Step 3: Investigate Underlying Disk I/O or Improper Shutdown Causes

  • Open Event Viewer (Windows Server 2025 / Windows 11) and navigate to Windows Logs > System to check for unexpected reboots or power failures correlating with the checkpoint message.
  • Use sys.dm_io_virtual_file_stats DMV to check for I/O stalls on the database files:
SELECT * FROM sys.dm_io_virtual_file_stats(DB_ID('YourDatabaseName'), NULL);
  • If disk latency is high, migrate database files to faster storage (e.g., NVMe SSD) or verify the storage subsystem via Performance Monitor using the Avg. Disk sec/Read and Avg. Disk sec/Write counters.

Step 4: Suppress Verbose Logging (Optional, Low-Priority Fix)

  • If the message is cluttering logs excessively during routine operations, enable Trace Flag 3226 to suppress successful backup messages and reduce log noise (Note: this does not suppress 3454 directly but cleans related checkpoint/backup chatter).
  • Add the startup parameter via SQL Server Configuration Manager > SQL Server Services > Right-click SQL Server instance > Properties > Startup Parameters: add -T3226.
  • Restart the SQL Server service for the change to take effect.

Alternative or Verification Steps

  • Verify the fix by monitoring the SQL Server Error Log for 24–48 hours post-configuration changes; the message should only appear during legitimate startup/recovery events, not during normal runtime.
  • If checkpoints are excessively frequent even after tuning the recovery interval, use sys.dm_os_performance_counters to monitor the “Checkpoint pages/sec” counter and correlate with workload patterns to rule out application-level transaction log bloat.

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

Troubleshooting Guide: Error 3453 — Cannot Redo Non-Logged Operation During Restore

Why This Error Happens

Error 3453 occurs when restoring a transaction log backup that contains a minimally logged (non-logged) operation, such as an index creation or bulk load, performed while the database was in SIMPLE or BULK_LOGGED recovery model. Because non-logged operations do not record enough detail in the transaction log to physically reconstruct the data pages, SQL Server 2025 cannot “redo” the operation during roll-forward, breaking the restore chain. This typically happens when a full database backup was taken immediately after the bulk-logged transaction, but the log backup covering that operation is missing, corrupted, or was taken while the recovery model didn’t fully support point-in-time recovery.

Step-by-Step Resolution Guide

Step 1: Verify the Recovery Model and Backup Chain

  • Open SQL Server Management Studio (SSMS) and run SELECT name, recovery_model_desc FROM sys.databases WHERE name = 'YourDatabase';
  • Confirm whether the database was in BULK_LOGGED or SIMPLE recovery model at the time of the backup.
  • Check msdb.dbo.backupset for the sequence of full, differential, and log backups to identify gaps.

Step 2: Restore Using a Full Backup Taken After the Non-Logged Operation

  • Locate the most recent full database backup created after the minimally logged operation completed.
  • Run the restore command: RESTORE DATABASE [YourDatabase] FROM DISK = 'C:\Backups\YourDatabase_Full.bak' WITH NORECOVERY;
  • Avoid applying any transaction log backup that spans the non-logged operation itself.

Step 3: Switch Recovery Model to FULL Before Future Bulk Operations

  • Change the database recovery model: ALTER DATABASE [YourDatabase] SET RECOVERY FULL;
  • Immediately take a full backup after switching models to establish a new, clean log chain.
  • Re-run the index creation or bulk insert operation under FULL recovery so it gets fully logged going forward.

Step 4: Rebuild the Log Backup Chain

  • Take a fresh full backup: BACKUP DATABASE [YourDatabase] TO DISK = 'C:\Backups\YourDatabase_Full_New.bak';
  • Schedule regular transaction log backups via SQL Server Agent to prevent future chain breaks.
  • Store backups on redundant storage (e.g., separate Windows Server 2025 volume or network share) to avoid file corruption issues.

Step 5: Validate Backup Integrity on Windows Server 2025

  • Run RESTORE VERIFYONLY FROM DISK = 'C:\Backups\YourDatabase_Full_New.bak'; to confirm the backup file is not corrupted.
  • Check Windows Event Viewer (Application log) for any disk I/O or antivirus interference errors that may have corrupted the backup file during write.

Alternative or Verification Steps

  • After restoring, run RESTORE HEADERONLY FROM DISK = 'C:\Backups\YourDatabase_Full.bak'; to confirm the backup’s LSN (Log Sequence Number) chain aligns with subsequent log backups before applying them.
  • If the original full backup predating the bulk operation is unavailable, the only reliable alternative is restoring from the last known-good full backup and manually re-applying any lost data/index changes, since the gap cannot be bridged with log backups alone.

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

Troubleshooting Guide: Error 3452 – Identity Value Inconsistency Detected During Recovery

Why This Error Happens

This error occurs when SQL Server’s crash recovery process detects that the internal identity value cache for a table does not match the actual last-used identity value, typically due to an unclean shutdown, power failure, or forced termination of the SQL Server service before committed transactions involving identity columns were fully flushed to disk. Because SQL Server 2025 caches identity values in memory for performance, a sudden restart can leave the on-disk metadata out of sync with what was actually allocated. This is a consistency warning rather than outright corruption, but if left unresolved, it can cause duplicate key errors or gaps when new rows are inserted into the affected table.

Step-by-Step Resolution Guide

Step 1: Confirm the Affected Database and Table

  • 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 on Windows Server 2025.
  • Note the database name and table ID (%d) referenced in the Error 3452 message.
  • Run the following query to resolve the table ID to a table name:
  SELECT OBJECT_NAME(object_id) FROM sys.objects WHERE object_id = <table_id>;

Step 2: Run DBCC CHECKIDENT to Reseed the Identity Value

  • Connect to the affected database using SSMS or sqlcmd.
  • Execute the command suggested in the error message, replacing the table name as needed:
  DBCC CHECKIDENT ('YourTableName', NORESEED);
  • Review the output showing the current identity value versus the maximum identity value in the table.
  • If a mismatch is confirmed, reseed explicitly:
  DBCC CHECKIDENT ('YourTableName', RESEED, <correct_max_value>);

Step 3: Validate Database Integrity

  • Run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to rule out underlying page-level corruption that may have triggered the inconsistency.
  • Check the Windows Event Viewer (Application and System logs) for disk I/O errors, unexpected shutdowns, or storage driver faults around the time of the crash.
  • If running on Windows Server 2025 with Storage Spaces or virtualized disks, verify the underlying storage controller firmware and drivers are up to date.

Step 4: Prevent Future Recurrence

  • Ensure the SQL Server service account has “Perform Volume Maintenance Tasks” and proper shutdown permissions configured in Local Security Policy (secpol.msc).
  • Configure a UPS or enable Windows Server 2025’s Fast Startup exclusions for the SQL Server host to avoid abrupt power-related shutdowns.
  • Enable SQL Server’s Trace Flag 272 only if your workload requires fully durable identity logging (note: this has a performance trade-off and should be tested first in a non-production environment).

Alternative or Verification Steps

  • Verify the fix by inserting a test row into the affected table and confirming the new identity value increments correctly without duplicate key violations.
  • If DBCC CHECKIDENT reports no change is needed or the error persists after reseeding, restore the database from the last known-good backup taken prior to the unclean shutdown, then reapply transaction log backups up to the point of failure.

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

Troubleshooting Guide: Error 3450 in Microsoft SQL Server 2025

Why This Error Happens

Error 3450 is an informational message generated by the SQL Server Database Engine during the crash recovery process, which runs automatically when a database starts after an unexpected shutdown, failover, or restore operation. This message simply reports the progress of the REDO/UNDO phases of recovery and does not indicate a failure by itself; however, prolonged or stalled recovery phases are often a symptom of underlying issues such as slow disk I/O, insufficient memory, a large number of uncommitted transactions in the log (VLFs), or corruption in the transaction log that is forcing an extended rollback. If the percentage complete stalls or the “seconds remain” value increases indefinitely, it usually points to hardware bottlenecks or log file corruption rather than normal recovery behavior.

Step-by-Step Resolution Guide

Step 1: Monitor the Actual Recovery Progress

  • Do not restart the SQL Server service, as this will force recovery to start over from the beginning, wasting the progress already made.
  • Query the DMV to check real-time status: SELECT * FROM sys.dm_exec_requests WHERE command = 'DB STARTUP';
  • Check the percent_complete and estimated_completion_time columns to confirm if progress is actually moving.

Step 2: Check Disk I/O and Hardware Health

  • Open Performance Monitor (Perfmon) on Windows Server 2025 and add the counter PhysicalDisk > Avg. Disk sec/Read and Avg. Disk sec/Write.
  • Values consistently above 20ms indicate a storage bottleneck that is slowing down the REDO phase.
  • Verify the drive hosting the .ldf (log) file is not running out of space via File Explorer or Get-PSDrive in PowerShell.
  • If using virtualized storage (Hyper-V/Azure), check the host-level storage queue depth for throttling.

Step 3: Allocate Sufficient Memory and Tempdb Resources

  • Navigate to SQL Server Management Studio (SSMS) > Right-click Server > Properties > Memory.
  • Ensure “Maximum server memory” is not capped too low, as insufficient buffer pool memory slows down the REDO/UNDO phase significantly.
  • Verify Tempdb files (located typically at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA) have adequate free space, as Phase 3 (Undo) often requires Tempdb for rollback operations.

Step 4: Inspect for Transaction Log Corruption

  • If recovery stalls specifically during “Phase 2” (Redo) or “Phase 3” (Undo) without progressing, check the SQL Server Error Log for accompanying I/O error messages (e.g., Error 823 or 824).
  • Navigate to the Log folder: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • If corruption is confirmed and no backup is viable, you may need to force the database into emergency mode for data retrieval:
    ALTER DATABASE [YourDB] SET EMERGENCY;

Step 5: Optimize Virtual Log File (VLF) Count for Future Prevention

  • Once the database is back online, check the VLF count to prevent future long recovery times: DBCC LOGINFO;
  • If the count is excessive (>1000), shrink and regrow the log file in controlled increments to optimize the VLF size:
    DBCC SHRINKFILE (YourDB_log, 1);

Alternative or Verification Steps

  • Verification: Once the message disappears from the SQL Server Error Log and the database status in sys.databases shows state_desc = 'ONLINE', the recovery process has successfully completed.
  • Alternative: If recovery hangs indefinitely (stuck at a specific percentage for hours) due to severe corruption, restore the database from the last known good full backup and transaction log backups rather than waiting for the UNDO phase to complete.

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

Troubleshooting Guide: SQL Server Error 3449 – Database Recovery Failure Forces Shutdown

Why This Error Happens

Error 3449 occurs when SQL Server 2025 encounters a database during the recovery phase (crash recovery, rollback, or roll-forward) that it cannot bring online, forcing the entire instance to shut down to prevent data corruption. This is typically caused by a corrupted transaction log, damaged data file (MDF/NDF), insufficient disk space for the recovery operation, or an interrupted shutdown that left a database in a suspect or inconsistent state. In some cases, it’s triggered by antivirus or backup software locking database files during the recovery sequence on Windows Server 2025.

Step-by-Step Resolution Guide

Step 1: Review the SQL Server Error Log for the Failing Database ID

  • Open the SQL Server Error Log via SQL Server Management Studio (SSMS) under Management > SQL Server Logs, or navigate directly to the log file path: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG
  • Search for the specific database ID referenced in Error 3449 and cross-reference it using SELECT name, database_id FROM sys.databases;
  • Note whether the affected database is a system database (master, model, msdb, tempdb) or a user database, as this changes the recovery approach.

Step 2: Check Disk Space and File System Health

  • Confirm the drive hosting the MDF, NDF, and LDF files has at least 20% free space; recovery operations can fail silently if the disk is full.
  • Run chkdsk C: /f /r (replace with the correct drive letter) from an elevated Command Prompt and schedule a restart if prompted.
  • Verify that antivirus or Windows Defender exclusions are set for the SQL Server data directory, typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\

Step 3: Attempt Manual Database Recovery in Single-User Mode

  • Stop the SQL Server service via services.msc or run NET STOP MSSQLSERVER in an elevated Command Prompt.
  • Restart the instance in single-user mode using NET START MSSQLSERVER /m"SQLCMD"
  • Connect via SQLCMD and attempt to set the database to emergency mode:
ALTER DATABASE [YourDBName] SET EMERGENCY;
DBCC CHECKDB([YourDBName]);
ALTER DATABASE [YourDBName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DBCC CHECKDB([YourDBName], REPAIR_ALLOW_DATA_LOSS);
ALTER DATABASE [YourDBName] SET MULTI_USER;

Step 4: Restore from the Most Recent Backup if Repair Fails

  • If DBCC CHECKDB reports unrecoverable corruption, restore the full backup followed by any differential and transaction log backups using RESTORE DATABASE [YourDBName] FROM DISK = 'D:\Backups\YourDBName.bak' WITH NORECOVERY;
  • Apply subsequent log backups in sequence and finish with WITH RECOVERY on the final restore command.

Step 5: If a System Database Is Affected, Rebuild via Setup

  • If master, model, or msdb is corrupted, run SQL Server 2025 Setup with the /ACTION=REBUILDDATABASE parameter from an elevated Command Prompt, pointing to the installation media.
  • After rebuilding, reattach or restore any user databases and reapply server-level logins and jobs from a recent backup of msdb and master.

Alternative or Verification Steps

  • After completing the steps above, restart the SQL Server service normally (not in single-user mode) and confirm the database status shows “ONLINE” via SELECT name, state_desc FROM sys.databases;
  • If the database remains inaccessible, consider attaching a known-good copy of the MDF/LDF files from a recent snapshot or Volume Shadow Copy (VSS) as a fallback before escalating to a full disaster recovery restore.

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

Troubleshooting Guide: SQL Server Error 3448

Why This Error Happens

Error 3448 occurs when the SQL Server Database Engine attempts to roll back a transaction but encounters a data page whose Log Sequence Number (LSN) is lower than expected, indicating the page on disk does not match what the transaction log expects. This is typically caused by physical database corruption, a damaged or incomplete I/O write (torn page), faulty storage hardware, or an improper shutdown that left data files in an inconsistent state. In most cases, this signals that the database files have suffered corruption that prevents the engine from safely completing crash recovery.

Step-by-Step Resolution Guide

Step 1: Isolate the Affected Database and Check Its State

  • Open SQL Server Management Studio (SSMS) or run SELECT name, state_desc FROM sys.databases; to confirm the database is stuck in RECOVERY_PENDING or SUSPECT mode.
  • Check the SQL Server Error Log (default path: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the exact LSN values and timestamp associated with Error 3448.
  • Stop any application traffic hitting this database immediately to prevent further writes.

Step 2: Run Hardware and Storage Diagnostics

  • Check Windows Event Viewer under Windows Logs > System for Disk, NTFS, or Storport errors around the same timestamp.
  • On Windows Server 2025 / Windows 11, run chkdsk C: /f /r (replace with the actual drive hosting the .mdf/.ldf files) during a maintenance window to repair file system-level corruption.
  • If using virtualized storage or SAN, verify there were no recent power failures, host crashes, or disconnected LUNs.

Step 3: Attempt Database Repair Using DBCC CHECKDB

  • Put the database into single-user or emergency mode first:
  • ALTER DATABASE [YourDB] SET EMERGENCY;
  • ALTER DATABASE [YourDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • Run a full consistency check: DBCC CHECKDB ('YourDB') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is confirmed, run DBCC CHECKDB ('YourDB', REPAIR_ALLOW_DATA_LOSS) only as a last resort, since this may discard corrupted pages.

Step 4: Restore From a Known Good Backup

  • If repair fails or data loss is unacceptable, restore the most recent full backup plus transaction log backups up to the point before corruption occurred.
  • Use RESTORE DATABASE [YourDB] FROM DISK = 'D:\Backups\YourDB_Full.bak' WITH NORECOVERY; followed by log restores, then WITH RECOVERY on the final log file.
  • Validate the backup chain integrity before restoring to avoid repeating the same corruption.

Step 5: Bring the Database Back Online and Monitor

  • Set the database back to multi-user mode: ALTER DATABASE [YourDB] SET MULTI_USER;
  • Re-run DBCC CHECKDB once more to confirm zero allocation or consistency errors.
  • Schedule more frequent DBCC CHECKDB jobs and enable Page Verify CHECKSUM (ALTER DATABASE [YourDB] SET PAGE_VERIFY CHECKSUM;) to catch torn pages early in the future.

Alternative or Verification Steps

  • Verify the fix by running DBCC CHECKDB ('YourDB') WITH NO_INFOMSGS, ALL_ERRORMSGS; again — a clean result with 0 allocation and consistency errors confirms resolution.
  • As an alternative if repair and restore both fail, engage Microsoft Customer Support Services (CSS) for advanced page-level recovery, or export recoverable data to a new database using the sp_generate_inserts or Import/Export Wizard before decommissioning the corrupted database.

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

Troubleshooting Guide: Error 3446 – Primary Log File Not Available

Why This Error Happens

Error 3446 occurs when SQL Server 2025 cannot locate or access the primary log file (LDF) associated with the database, typically because the file has been moved, deleted, or renamed outside of SQL Server’s control. This can also result from underlying storage issues, such as a disconnected volume, a corrupted file system, or antivirus software locking the file. In some cases, insufficient NTFS permissions for the SQL Server service account on the log file directory can trigger this same access failure.

Step-by-Step Resolution Guide

Step 1: Verify the Physical Log File Location

  • Open SQL Server Management Studio (SSMS) and run sys.master_files to check the expected path of the log file for the affected database.
  • Navigate to the default data path (e.g., C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\) in File Explorer to confirm the .ldf file physically exists.
  • Check Windows Server 2025 Disk Management to ensure the underlying volume (especially if using Storage Spaces or a SAN mount) is online and not in a “Reserved” or “Offline” state.

Step 2: Check NTFS Permissions and Service Account Access

  • Right-click the SQL Server DATA folder, select Properties > Security, and ensure the NT SERVICE\MSSQLSERVER (or your custom service account) has Full Control.
  • If permissions were recently reset by a Group Policy update on Windows Server 2025, manually re-apply the SQL Server service account permissions.
  • Restart the SQL Server service via services.msc after applying permission changes to ensure the lock is refreshed.

Step 3: Take the Database Offline and Online to Reset the Handle

  • Run the following T-SQL command to force SQL Server to release and re-acquire the file handle:
  ALTER DATABASE [YourDB] SET OFFLINE WITH ROLLBACK IMMEDIATE;
  ALTER DATABASE [YourDB] SET ONLINE;
  • Check the SQL Server Error Log immediately after running this command to see if the engine successfully remounts the log file.

Step 4: Restore the Log File from Backup (If File is Corrupted/Missing)

  • If the .ldf file is confirmed missing or corrupted, stop the SQL Server service completely.
  • Copy a valid backup of the .ldf file into the original directory path if available, or prepare to rebuild the log using emergency mode if no backup exists.
  • Use DBCC CHECKDB with the REPAIR_ALLOW_DATA_LOSS option only as a last resort if standard recovery steps fail.

Alternative or Verification Steps

  • Verification: Run DBCC SQLPERF(LOGSPACE) to confirm the database is reporting valid log space usage, and execute a test BACKUP LOG command to ensure the error does not reappear.
  • Alternative: If the log file remains inaccessible due to a hardware-level lock, detach the database (sp_detach_db) and re-attach it using CREATE DATABASE ... FOR ATTACH_REBUILD_LOG to force SQL Server to generate a new transaction log file.

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

Troubleshooting Guide: SQL Server Error 3447

Why This Error Happens

Error 3447 occurs when SQL Server cannot activate or scan one or more transaction log files during database startup or recovery, typically because the log file is corrupted, truncated, or inaccessible. This can result from abrupt system shutdowns, storage subsystem failures, insufficient disk space during log growth, or the SQL Server service account lacking the necessary NTFS permissions on the log file directory. In some cases, the VLF (Virtual Log File) header information becomes inconsistent, preventing SQL Server from reading the log chain correctly.

Step-by-Step Resolution Guide

Step 1: Verify File Permissions and Service Account Access

  • Confirm the SQL Server service account (e.g., NT Service\MSSQLSERVER or a custom domain account) has Full Control on the folder containing the .ldf file.
  • Navigate to the log file directory (commonly C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\) and check Security tab properties.
  • Restart the SQL Server service via services.msc after applying permission changes to confirm the fix took effect.

Step 2: Check Disk Space and Storage Health

  • Ensure the volume hosting the log file has sufficient free space; SQL Server cannot scan or extend a log file on a full disk.
  • Run chkdsk C: /f /r (adjust drive letter) in an elevated Command Prompt to check for underlying disk corruption.
  • Review Windows Event Viewer under Windows Logs > System for Disk or NTFS warnings coinciding with the SQL Server crash.

Step 3: Attempt Database Recovery in Emergency Mode

  • Set the database to EMERGENCY mode using: ALTER DATABASE YourDB SET EMERGENCY;
  • Run a consistency check: DBCC CHECKDB (YourDB, REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS; (only after taking a full backup copy of the files).
  • If the log is unreadable, detach the database and attempt to rebuild the log using ALTER DATABASE YourDB REBUILD LOG ON (NAME=YourDB_log, FILENAME='X:\Path\YourDB_log.ldf'); as a last resort.

Step 4: Restore From a Known Good Backup

  • If repair attempts fail, restore the full backup followed by the latest differential and transaction log backups.
  • Use: RESTORE DATABASE YourDB FROM DISK = 'X:\Backup\YourDB.bak' WITH NORECOVERY; followed by subsequent log restores WITH RECOVERY on the final file.
  • Validate backup integrity beforehand using RESTORE VERIFYONLY FROM DISK = 'X:\Backup\YourDB.bak';

Alternative or Verification Steps

  • After applying a fix, bring the database online with ALTER DATABASE YourDB SET ONLINE; and run DBCC CHECKDB to confirm no further corruption errors appear in the SQL Server Error Log.
  • If the issue persists, detach the database, move the .mdf/.ldf files to a healthy storage volume, and reattach using sp_attach_db to rule out hardware-level disk faults.

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

Troubleshooting Guide: Error 3445 – Invalid Undo File in SQL Server 2025

Why This Error Happens

Error 3445 occurs when SQL Server attempts to apply a transaction log backup using STANDBY mode, but the specified undo (.tuf) file is either corrupted, missing, or does not match the database ID it was originally created for. This typically happens when the undo file path has changed, the file was manually deleted or overwritten, or a mismatched undo file from a different database/restore sequence is being referenced. File system permission issues on the undo file directory can also prevent SQL Server from reading the file’s header correctly, triggering this validation failure.

Step-by-Step Resolution Guide

Step 1: Verify the Undo File Path and Existence

  • Confirm the exact path specified in the WITH STANDBY = 'path\filename.tuf' clause of your restore command.
  • Navigate to the folder (e.g., C:\SQLUndo\ or D:\MSSQL\Undo\) using File Explorer or PowerShell to confirm the .tuf file physically exists.
  • Run Get-ChildItem -Path "C:\SQLUndo\" -Filter *.tuf in PowerShell to list all undo files and check timestamps.

Step 2: Check File Permissions and Service Account Access

  • Ensure the SQL Server service account (visible in SQL Server Configuration Manager) has Read/Write/Modify permissions on the undo file directory.
  • Right-click the folder, go to Properties > Security, and add the SQL Server service account (e.g., NT Service\MSSQLSERVER) with Full Control if missing.
  • Restart the SQL Server service after updating permissions: Restart-Service -Name 'MSSQLSERVER'.

Step 3: Discard the Corrupted Undo File and Restart the Restore Sequence

  • Stop the restore sequence and run RESTORE DATABASE [YourDB] WITH RECOVERY to roll back and clear the invalid standby state if the database is stuck in restoring mode.
  • Delete the corrupted or mismatched .tuf file manually from the directory.
  • Re-run the log restore command with a freshly specified undo file path, ensuring it is unique per database: RESTORE LOG [YourDB] FROM DISK = 'logbackup.trn' WITH STANDBY = 'C:\SQLUndo\YourDB_new.tuf';

Step 4: Validate Database ID Consistency

  • Query SELECT name, database_id FROM sys.databases; to confirm the database ID matches what the undo file expects.
  • If database ID mismatches occur (common after restoring to a different server), avoid reusing undo files across different database instances or IDs.

Alternative or Verification Steps

  • Verify the fix by running the restore command again and confirming the database enters STANDBY mode without errors; check sys.databases for state_desc = 'STANDBY'.
  • If the issue persists, switch to WITH NORECOVERY instead of STANDBY for the log restore chain, then apply WITH RECOVERY only on the final log file to bypass undo file dependency entirely.

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

Troubleshooting Guide: SQL Server Error 3443 — Database Marked for Standby or Read-Only Use

Why This Error Happens

This error occurs when SQL Server attempts to write to or modify a database that is currently in STANDBY or READ_ONLY mode, typically as part of a log shipping configuration. The restore process places the secondary database in a state where it accepts transaction log restores but rejects direct write operations from users or applications. This conflict commonly arises when an application connection string incorrectly points to the secondary (standby) server instead of the primary, or when a scheduled job attempts to write to the database during an active restore sequence.

Step-by-Step Resolution Guide

Step 1: Verify the Database State and Role

  • Open SQL Server Management Studio (SSMS) and connect to the instance reporting the error.
  • Run SELECT name, state_desc, is_read_only FROM sys.databases WHERE name = 'YourDatabaseName'; to confirm if the database is in STANDBY or READ_ONLY state.
  • Check if this database is part of a Log Shipping or Always On Availability Group topology via SSMS > Management > Log Shipping Monitor.

Step 2: Redirect Write Operations to the Primary Server

  • Identify the primary (production) server in the log shipping or replication topology.
  • Update the application’s connection string or DNS alias (CNAME) to point to the primary instance rather than the standby instance.
  • On Windows Server 2025, check C:\Windows\System32\drivers\etc\hosts or your DNS management console if a hardcoded alias is causing the misdirection.

Step 3: Adjust Standby Database Permissions (If Read-Only Access Is Intended)

  • If the database is intentionally read-only for reporting purposes, ensure the application or user is only executing SELECT statements and not INSERT, UPDATE, or DELETE commands.
  • Modify the application logic to separate read-only reporting queries from transactional write operations.
  • If write access is required, work with your DBA to remove the database from the log shipping secondary role using RESTORE DATABASE [YourDatabaseName] WITH RECOVERY; (Note: this will break the log shipping chain).

Step 4: Review SQL Server Agent Jobs

  • Open SQL Server Agent > Jobs in SSMS and look for any ETL, maintenance, or custom jobs scheduled to run write operations against the standby database.
  • Disable or reschedule any job incorrectly targeting the secondary server.
  • Check the SQL Server Error Log located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for the specific job or login ID that triggered the write attempt.

Alternative or Verification Steps

  • To verify the fix, run a test transaction (e.g., a harmless UPDATE to a test table) against the primary server connection string and confirm it completes without triggering Error 3443.
  • If the error persists despite connecting to the correct primary server, check for an orphaned Availability Group listener or stale DNS cache entry by running ipconfig /flushdns on the Windows Server 2025 host and retesting the connection.

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

Troubleshooting Guide: SQL Server Error 3441 – Warm Standby Database Startup Failure

Why This Error Happens

Error 3441 occurs when SQL Server 2025 attempts to bring a warm standby database (one being restored via log shipping with NORECOVERY or STANDBY mode) online during startup, but encounters an inconsistency that prevents the recovery process from completing. This is typically caused by a corrupted or incomplete transaction log file, a mismatch between the database’s physical files and its metadata in msdb or the primary replica, or an interrupted restore sequence where a transaction log backup was applied out of order or skipped entirely. Insufficient disk space or abrupt termination of SQL Server during a previous standby restore operation can also leave the standby database in an unrecoverable state, triggering this error on the next service start.

Step-by-Step Resolution Guide

Step 1: Verify the Restore Sequence and Log Chain

  • Check the SQL Server Error Log (located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the full context surrounding Error 3441.
  • Run RESTORE HEADERONLY FROM DISK = 'path_to_log_backup.trn' to confirm the LSN (Log Sequence Number) chain is unbroken.
  • Confirm that no transaction log backups were skipped between the last full/differential restore and the current standby state.

Step 2: Rebuild the Standby Database from a Clean Base

  • Take the standby database offline using SQL Server Management Studio (SSMS) or ALTER DATABASE [YourDB] SET OFFLINE WITH ROLLBACK IMMEDIATE;.
  • Delete the existing .mdf, .ndf, and .ldf files from the data directory (commonly C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).
  • Restore a fresh full backup from the primary server using WITH NORECOVERY, then reapply transaction log backups sequentially using WITH STANDBY = 'C:\SQLStandby\undo_YourDB.ldf'.

Step 3: Check Disk Space and File Permissions

  • Confirm the standby server has sufficient free disk space on the drive hosting the data and log files; low space can corrupt the undo file during standby mode.
  • Open services.msc and verify the SQL Server service account has Full Control permissions on the data, log, and undo file directories.
  • Review Windows Event Viewer (Windows Logs > Application) for any disk I/O or access-denied errors coinciding with Event ID 3441.

Step 4: Resynchronize Log Shipping Configuration

  • Open SSMS, navigate to the database properties, and select Transaction Log Shipping to verify the job schedules for backup, copy, and restore are functioning correctly.
  • Manually trigger the Log Shipping Restore Job from SQL Server Agent to ensure the standby database picks up the correct sequence of logs without gaps.
  • Validate that the primary and secondary server times are synchronized via NTP, as time drift can cause job scheduling conflicts that interrupt log shipping.

Alternative or Verification Steps

  • After completing the restore sequence, run SELECT name, state_desc FROM sys.databases WHERE name = 'YourDB'; and confirm the state_desc shows STANDBY instead of RECOVERY_PENDING or SUSPECT.
  • If the issue persists, consider switching the standby method entirely to SQL Server Always On Availability Groups or Database Mirroring, which handle log synchronization more robustly than manual log shipping in SQL Server 2025.

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

Troubleshooting Guide: SQL Server Error 3434 — Reindexing Failure During Collation Change

Why This Error Happens

Error 3434 occurs when SQL Server attempts to rebuild all system and user indexes under a new collation (sort order/locale) during a rebuildm or setup-driven collation change, but fails partway through the process. This is commonly caused by insufficient disk space for the temporary index rebuild operations, corrupted system table structures, incompatible or deprecated collation IDs, or insufficient permissions on the SQL Server service account to access the Data and Log directories. Because the operation is transactional at the server level, any interruption forces SQL Server to halt and revert, leaving the instance unable to start cleanly until the underlying issue is resolved.

Step-by-Step Resolution Guide

Step 1: Verify Disk Space and File Permissions

  • Confirm the drive hosting C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA has at least 2-3x the size of your largest database free (reindexing requires temporary duplicate storage).
  • Check that the SQL Server service account (visible in SQL Server Configuration Manager) has Full Control on the DATA and LOG folders.
  • Right-click the folder → Properties → Security tab → confirm NT SERVICE\MSSQLSERVER or your custom service account is listed with write access.

Step 2: Run the Rebuild Utility Manually with Verbose Logging

  • Stop the SQL Server service via Services.msc or net stop MSSQLSERVER.
  • Navigate to C:\Program Files\Microsoft SQL Server\170\Tools\Binn\ and locate rebuildm.exe (or use setup.exe /ACTION=RebuildDatabase for SQL Server 2025 setup-based rebuilds).
  • Launch the tool as Administrator and re-select your target collation (e.g., SQL_Latin1_General_CP1_CI_AS).
  • Export the rebuild log from %ProgramFiles%\Microsoft SQL Server\170\Setup Bootstrap\Log\ and inspect for the specific failing object (table, index, or system catalog).

Step 3: Restore System Databases from a Known-Good Backup

  • If the master, model, or msdb databases were mid-rebuild when the failure occurred, restore them from your last verified backup.
  • Use SQL Server in single-user mode: sqlservr.exe -m -T3608 to start without fully initializing tempdb/other databases.
  • Run RESTORE DATABASE master FROM DISK = 'path_to_backup.bak' WITH REPLACE from the SQLCMD prompt if master is corrupted.

Step 4: Rebuild the Instance Using Setup (If Manual Rebuild Fails)

  • Launch SQL Server 2025 Installation Center → Maintenance → Repair.
  • Select the affected instance and choose Rebuild System Databases rather than repair, specifying the desired collation explicitly in the /SQLCOLLATION parameter.
  • Example command-line invocation: Setup.exe /QUIET /ACTION=RebuildDatabase /INSTANCENAME=MSSQLSERVER /SQLSYSADMINACCOUNTS=BUILTIN\Administrators /SQLCOLLATION=SQL_Latin1_General_CP1_CI_AS

Alternative or Verification Steps

  • After rebuilding, run SELECT SERVERPROPERTY('Collation'); in a new query window to confirm the collation was applied correctly and the instance started without errors.
  • If the rebuild still fails, consider a clean uninstall/reinstall of the instance and restoring user databases from backup rather than attempting an in-place collation change, since cross-collation restores are generally safer than live reindexing.

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

Troubleshooting Guide: Error 3437 – MS DTC Recovery Failure in SQL Server 2025

Why This Error Happens

This error occurs when SQL Server attempts to recover a database containing in-doubt distributed transactions but cannot communicate with the Microsoft Distributed Transaction Coordinator (MS DTC) service to verify their completion status. The root cause is typically that the MS DTC service is stopped, disabled, or not properly configured to allow network/local communication, or the required firewall ports are blocked. This can also happen after a server migration or restore where the DTC security configuration does not match the original settings, or where local and distributed transaction permissions were not granted to the SQL Server service account.

Step-by-Step Resolution Guide

Step 1: Verify and Start the MS DTC Service

  • Open Services.msc on Windows Server 2025 / Windows 11.
  • Locate Distributed Transaction Coordinator and ensure the Startup Type is set to Automatic.
  • If stopped, right-click and select Start.
  • Alternatively, run this in an elevated PowerShell prompt:
  Set-Service -Name MSDTC -StartupType Automatic
  Start-Service -Name MSDTC

Step 2: Configure MS DTC Security Settings

  • Open Component Services (dcomcnfg.exe).
  • Navigate to Component Services > Computers > My Computer > Distributed Transaction Coordinator > Local DTC.
  • Right-click Local DTC, select Properties, then go to the Security tab.
  • Enable the following checkboxes:
  • Network DTC Access
  • Allow Inbound / Allow Outbound
  • Enable XA Transactions (if applicable)
  • Mutual Authentication Required (or No Authentication Required for test/lab environments)
  • Click OK and allow the DTC service to restart automatically.

Step 3: Check Firewall and Port Configuration

  • Confirm Windows Firewall allows DTC traffic by enabling the predefined rule:
  Enable-NetFirewallRule -DisplayGroup "Distributed Transaction Coordinator"
  • Verify RPC port range (default dynamic range 135, plus ephemeral ports) is not blocked between nodes if running in a clustered or multi-server environment.
  • If using a static DTC port, confirm it matches on both the SQL Server host and any linked server/MSDTC resource manager.

Step 4: Validate SQL Server Service Account Permissions

  • Ensure the SQL Server service account has Act as part of the operating system and Impersonate a client after authentication rights via Local Security Policy > User Rights Assignment.
  • Confirm the account has sufficient permissions on the %SystemRoot%\System32\MSDtc registry and folder structure.
  • Restart the SQL Server service after applying changes:
  Restart-Service -Name MSSQLSERVER

Step 5: Rebuild DTC Log (If Corruption Suspected)

  • Stop the MSDTC service.
  • Delete or rename the existing DTC log file located at C:\Windows\System32\MSDtc\MSDTC.LOG.
  • Restart the MSDTC service to regenerate a fresh log file.
  • Attempt the database recovery operation again.

Alternative or Verification Steps

  • Run sp_helpdistributedtrxlist in SQL Server Management Studio to confirm no orphaned in-doubt transactions remain after applying the fix.
  • If the error persists, use DTCPing.exe or DTCTester.exe between the SQL Server node and any remote resource managers to confirm DTC connectivity is fully restored.

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

Troubleshooting Guide: SQL Server Error 3431 – Database Recovery Failure Due to Unresolved MS DTC Transactions

Why This Error Happens

This error occurs when SQL Server attempts to recover a database during startup but finds one or more transactions that were prepared under MS DTC and never received a final commit or rollback instruction. This typically happens because the MS DTC service was stopped, uninstalled, or its transaction log was corrupted/reset while distributed transactions were still in-flight. Without access to the original DTC transaction manager state, SQL Server cannot determine whether to commit or roll back the prepared transaction, so it halts database recovery to prevent data inconsistency.

Step-by-Step Resolution Guide

Step 1: Verify MS DTC Service Status

  • Open Services.msc on the affected Windows Server 2025 / Windows 11 machine.
  • Confirm Distributed Transaction Coordinator is set to “Running” and Startup Type is “Automatic.”
  • If stopped, start it manually: net start msdtc
  • Check Event Viewer under Applications and Services Logs > Microsoft > Windows > MSDTC for related failures.

Step 2: Identify the In-Doubt Transaction

  • Open SQL Server Management Studio (SSMS) and run:
SELECT * FROM sys.dm_tran_database_transactions WHERE database_id = DB_ID('YourDBName');
  • Alternatively, check for orphaned transactions using:
EXEC sp_configure 'in-doubt transaction';
  • Note the Transaction UOW (Unit of Work) ID returned by DTC, found via msdtc Component Services snap-in under Transaction List.

Step 3: Manually Resolve the Transaction

  • Open Component Services (dcomcnfg.exe), navigate to Distributed Transaction Coordinator > Local DTC > Transaction List.
  • Locate the transaction matching the UOW ID from Step 2.
  • Right-click and choose Commit or Abort depending on business logic (if unsure, Abort is safer to prevent partial writes).
  • If the transaction doesn’t appear in the DTC list (orphaned reference), force resolution in SQL Server:
KILL '<transaction UOW GUID>' WITH ROLLBACK IMMEDIATE;

Step 4: Rebuild or Reset MS DTC (If Corrupted)

  • If MSDTC logs are corrupted, reset the DTC configuration:
msdtc -uninstall
msdtc -install
net start msdtc
  • Restart the SQL Server service afterward to re-attempt database recovery:
net stop MSSQLSERVER
net start MSSQLSERVER

Step 5: Bring the Database Back Online

  • Once the in-doubt transaction is resolved, attempt to bring the database online:
ALTER DATABASE YourDBName SET ONLINE;
  • Monitor the SQL Server Error Log (Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) to confirm successful recovery.

Alternative or Verification Steps

  • Run DBCC CHECKDB('YourDBName') after bringing the database online to confirm no structural corruption resulted from the forced rollback.
  • If the database still fails to recover, restore from the last known good backup and manually reapply transactions logged outside the DTC scope to avoid repeated in-doubt transaction errors.

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

Troubleshooting Guide: Error 3429 – Cross-Database Transaction Recovery Failure

Why This Error Happens

Error 3429 occurs when SQL Server’s recovery process cannot resolve the final state (commit or rollback) of a distributed or cross-database transaction, typically because the Microsoft Distributed Transaction Coordinator (MS DTC) service was unavailable or unreachable during the recovery phase. This often happens after an unexpected shutdown, a failed cluster failover, or when the MSDTC log and the SQL Server transaction log fall out of sync due to corruption or a mismatched restart sequence. In some cases, this is also triggered by inconsistent service startup order, where SQL Server starts recovery before MSDTC is fully initialized on Windows Server 2025 or Windows 11.

Step-by-Step Resolution Guide

Step 1: Verify and Restart the MSDTC Service

  • Open Services.msc on the affected Windows Server 2025 / Windows 11 machine.
  • Locate Distributed Transaction Coordinator, confirm it is set to Automatic, and restart it.
  • Alternatively, run the following in an elevated Command Prompt:
net stop msdtc
net start msdtc

Step 2: Check and Repair MSDTC Log Consistency

  • Navigate to C:\Windows\System32\MSDTC\MSDTC.LOG and confirm the file is not corrupted or zero-byte.
  • If corrupted, reconfigure MSDTC logging via:
msdtc -uninstall
msdtc -install
  • Ensure the MSDTC log path has sufficient disk space and correct NTFS permissions for the NT AUTHORITY\NetworkService account.

Step 3: Correct Service Startup Dependencies

  • Open Registry Editor and navigate to:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLSERVER
  • Add MSDTC as a dependency so SQL Server waits for it to fully start before beginning recovery.
  • Restart the SQL Server (MSSQLSERVER) service and monitor the SQL Server Error Log for recovery completion messages.

Step 4: Force Resolution of the Orphaned Transaction

  • If the transaction remains unresolved after service restarts, use:
SELECT * FROM sys.dm_tran_database_transactions;
  • Identify the orphaned XID and manually resolve it using:
KILL '<transaction_UOW>';
  • If KILL fails, use sp_resetstatus on the affected database as a last resort (only after a full backup).

Alternative or Verification Steps

  • Re-run the SQL Server startup and check the Error Log for the message “Recovery is complete” with no further 3429 entries.
  • If the issue persists, restore the affected database from the last known good backup and replay transaction logs to bypass the corrupted distributed transaction state.

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

Troubleshooting Guide: SQL Server Error 3423

Why This Error Happens

Error 3423 typically appears as an informational message indicating that the SQL Server instance started in multiuser mode rather than single-user mode, which usually occurs after a database recovery operation or maintenance task was expected to run in a restricted state. This can happen when startup parameters (like -m) were not applied correctly, when a previous single-user session was not properly closed, or when configuration changes made during a restore/recovery process were overridden by default service startup settings. In some cases, this message surfaces because a scheduled task, Group Policy, or failover cluster resource manager restarted the SQL Server service without preserving the intended startup flags.

Step-by-Step Resolution Guide

Step 1: Verify Current Startup Parameters

  • Open SQL Server Configuration Manager on Windows Server 2025 / Windows 11.
  • Navigate to SQL Server Services > right-click your instance > Properties > Startup Parameters tab.
  • Check whether -m (single-user mode) is present if it was intended for maintenance tasks.
  • Confirm the parameter order and syntax: -d, -l, -e paths should not be malformed.

Step 2: Correct the Startup Mode Configuration

  • If single-user mode was required for a specific task (e.g., restoring master database), add the parameter manually:
  • -m"SQLCMD" (restricts access to a single application/user)
  • Restart the SQL Server service via:
  net stop MSSQLSERVER
  net start MSSQLSERVER
  • If multiuser mode is actually the desired state, no action is needed — document the message as informational only.

Step 3: Check for Conflicting Services or Scripts

  • Review Task Scheduler and Windows Services (services.msc) for any automated scripts that restart the SQL Server service outside of maintenance windows.
  • Inspect SQL Server Error Log at:
  C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG
  • Look for entries immediately before Error 3423 to identify what triggered the restart.

Step 4: Validate Cluster or Always On Availability Group Settings (If Applicable)

  • If running on a Windows Server Failover Cluster (WSFC), open Failover Cluster Manager.
  • Confirm the SQL Server resource’s startup parameters match the intended configuration under Resource Properties > Properties tab.
  • Ensure no conflicting resource dependencies are forcing a service restart in multiuser mode unexpectedly.

Alternative or Verification Steps

  • Run SELECT SERVERPROPERTY('IsSingleUser'); in SSMS — a result of 0 confirms the instance is correctly in multiuser mode.
  • If the message persists unexpectedly, review the Windows Event Viewer (Application Log) for correlating Service Control Manager events that may indicate an external restart trigger.

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

Troubleshooting Guide: SQL Server Error 3421 — Recovery Completed Message with Anomalies

Why This Error Happens

This message is logged by the SQL Server Engine during the database recovery process, which runs automatically whenever a database is brought online after a shutdown, failover, or restart. While often informational, when paired with unusually long analysis or redo times, it typically indicates that the Transaction Log (LDF) contains a large number of uncommitted transactions that need to be rolled back, or that the underlying storage subsystem is experiencing I/O latency. In more severe cases, this delay is a precursor to log corruption caused by an unexpected power loss or a faulty storage driver on Windows Server 2025.

Step-by-Step Resolution Guide

Step 1: Analyze the SQL Server Error Log

  • Open SQL Server Management Studio (SSMS) and navigate to Management > SQL Server Logs.
  • Look for the specific phases: “Analysis,” “Redo,” and “Undo” to identify which specific phase is consuming the most time (I64d ms).
  • Cross-reference the timestamp with Windows Event Viewer (Event ID 3421) to check for concurrent disk warnings.

Step 2: Check Storage Subsystem Health and Latency

  • Open Resource Monitor on Windows Server 2025 and check the “Disk” tab for high queue lengths on the drive hosting your .mdf and .ldf files.
  • Verify that the storage drivers are up to date via Device Manager > Disk Drives.
  • Run the following T-SQL query to check for I/O stalls:
SELECT * FROM sys.dm_io_virtual_file_stats(DB_ID('YourDatabaseName'), NULL);

Step 3: Increase Recovery Interval Configuration

  • If the database is large and checkpoints aren’t frequent enough, manually adjust the recovery interval to force more frequent checkpoints, reducing future recovery times.
  • Execute the following command in a New Query window:
EXEC sp_configure 'recovery interval', '0';
RECONFIGURE;
  • Restart the SQL Server service via services.msc for the changes to take effect fully.

Step 4: Validate Database Integrity

  • Run a full consistency check to ensure the lengthy recovery didn’t mask underlying corruption in the data pages.
  • Use the following command:
DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If errors are returned, proceed to restore from the last known good backup rather than using repair options that might cause data loss.

Alternative or Verification Steps

  • Verify the Fix: Restart the SQL Server service (MSSQLSERVER) via PowerShell using Restart-Service MSSQLSERVER and monitor the Error Log to confirm the “Recovery completed” time has significantly decreased.
  • Alternative Solution: If recovery times remain high due to hardware limitations, consider migrating the transaction log file to a dedicated high-speed SSD volume separate from the data files to reduce I/O contention.

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

Troubleshooting Guide: SQL Server Error 3422 — Database Shutdown Due to Internal Error

Why This Error Happens

Error 3422 occurs when the SQL Server Database Engine encounters a critical internal error while executing a specific routine, forcing it to take the database offline to prevent further damage or data corruption. This is most commonly triggered by corrupted data pages, damaged transaction log files, or unexpected I/O failures at the storage subsystem level. In some cases, it can also stem from insufficient disk space or a failing/misconfigured disk controller that interrupts a write operation mid-transaction.

Step-by-Step Resolution Guide

Step 1: Review the SQL Server Error Log for Context

  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG (path may vary based on instance name/version).
  • Search for the specific error number (%d) and routine name (%hs) referenced alongside the 3422 message to identify the exact failing component (e.g., a storage engine or buffer pool routine).
  • Cross-reference the timestamp with Windows Event Viewer (eventvwr.msc) under Windows Logs > System to check for underlying disk or hardware warnings.

Step 2: Check Database and Disk Integrity

  • Open SQL Server Management Studio (SSMS) and run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to detect corruption.
  • Verify the physical disk hosting the .mdf and .ldf files is healthy by running chkdsk C: /f /r (replace C: with the appropriate drive letter) from an elevated Command Prompt, then reboot if prompted.
  • Confirm there is adequate free disk space (at least 15-20% free) on the volume to avoid log or tempdb growth failures.

Step 3: Restart SQL Server and Allow Auto-Recovery

  • Since the error indicates SQL Server will attempt a restart once connections are aborted, manually terminate any lingering sessions using KILL <session_id> via SSMS if they are not clearing automatically.
  • Restart the SQL Server service via services.msc or by running net stop MSSQLSERVER && net start MSSQLSERVER in an elevated Command Prompt.
  • Monitor the ERRORLOG again to confirm the database transitions from “Recovery Pending” to “Online.”

Step 4: Restore from Backup if Corruption Persists

  • If DBCC CHECKDB reports unrepairable corruption, restore the database from the last known good backup using RESTORE DATABASE [YourDatabaseName] FROM DISK = 'E:\Backups\YourDatabase.bak' WITH REPLACE;.
  • Ensure the backup file integrity is verified beforehand using RESTORE VERIFYONLY FROM DISK = 'E:\Backups\YourDatabase.bak';.

Alternative or Verification Steps

  • Verify the fix by querying sys.databases and confirming the state_desc column shows ONLINE for the affected database: SELECT name, state_desc FROM sys.databases WHERE name = 'YourDatabaseName';.
  • If the issue recurs intermittently, update storage drivers and firmware on Windows Server 2025/Windows 11, and consider running SQL Server in a different I/O mode (e.g., toggling Instant File Initialization or adjusting antivirus exclusions for the .mdf/.ldf directories) to rule out third-party I/O interference.

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

Troubleshooting Guide: SQL Server Error 3420 – Database Snapshot Marked Suspect

Why This Error Happens

Error 3420 occurs when the sparse file backing a database snapshot encounters an I/O failure, typically due to the underlying storage volume running out of disk space or experiencing a hardware-level read/write error. Since database snapshots rely on a copy-on-write mechanism using NTFS sparse files, any interruption—such as the source volume being disconnected, a permissions change on the snapshot directory, or disk corruption—causes SQL Server to mark the snapshot as “suspect” because it can no longer guarantee transactional consistency. Once marked suspect, the snapshot is permanently unusable and SQL Server will not attempt to self-heal it, requiring manual intervention.

Step-by-Step Resolution Guide

Step 1: Confirm the Snapshot is Unrecoverable

  • Run SELECT name, state_desc FROM sys.databases WHERE name = 'YourSnapshotName'; to confirm the state is SUSPECT.
  • Check the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for accompanying I/O error details (e.g., Error 823 or 824) that may indicate the root disk issue.
  • Verify the sparse file’s underlying volume isn’t full by checking Disk Management or running Get-PSDrive in PowerShell.

Step 2: Drop the Suspect Snapshot

  • Since suspect snapshots cannot be repaired, they must be removed:
DROP DATABASE YourSnapshotName;
  • If the standard DROP DATABASE command hangs or fails due to the suspect state, force removal using:
ALTER DATABASE YourSnapshotName SET OFFLINE WITH ROLLBACK IMMEDIATE;
DROP DATABASE YourSnapshotName;

Step 3: Investigate and Resolve the Underlying Storage Issue

  • Open Event Viewer (eventvwr.msc) and navigate to Windows Logs > System to check for Disk or NTFS warnings (Event IDs 7, 11, 51, or 153) around the time of the failure.
  • Confirm the volume hosting the snapshot file has sufficient free space; sparse files grow dynamically and can consume the entire volume unexpectedly.
  • If using storage spaces or a SAN/NAS backend, verify connectivity and check the storage controller logs for transient disconnects.

Step 4: Recreate the Database Snapshot

  • Once the storage issue is resolved, recreate the snapshot pointing to a volume with adequate free space:
CREATE DATABASE YourSnapshotName ON
(
    NAME = YourDB_Data,
    FILENAME = 'D:\SQLSnapshots\YourSnapshotName.ss'
)
AS SNAPSHOT OF YourDB;
  • Ensure the SQL Server service account has write permissions on the target directory (D:\SQLSnapshots) via Properties > Security in Windows Explorer.

Step 5: Schedule Proactive Monitoring

  • Set up a SQL Agent Alert on Error 3420 or configure a PowerShell script using Get-Counter to monitor free disk space on volumes hosting snapshots.
  • Consider moving snapshot files to dedicated, monitored storage separate from production data files to avoid future space contention.

Alternative or Verification Steps

  • After recreating the snapshot, run SELECT state_desc FROM sys.databases WHERE name = 'YourSnapshotName'; and confirm the state reads ONLINE.
  • If snapshots continue to fail intermittently, consider using native backups or Always On Availability Group secondary replicas as a more resilient alternative to snapshot-based point-in-time reporting.

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

Troubleshooting Guide: Error 3419 — Recovery Skipped Due to Required Upgrade While Database Marked for Standby

Why This Error Happens

This error occurs when a database in a log-shipping or restore sequence is set to Standby mode, but SQL Server 2025 detects that the database’s internal version requires an upgrade step during recovery. Standby mode opens the database as read-only with an undo file, which is incompatible with the schema/version upgrade process that must run during the final recovery phase. This typically happens after restoring a backup taken on an older SQL Server version (or a different build) into a newer SQL Server 2025 instance while using WITH STANDBY instead of WITH NORECOVERY.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Database and Current State

  • Open SQL Server Management Studio (SSMS) or run a query against sys.databases to check the state_desc column for the affected database.
  • Confirm the database is currently in STANDBY mode by running:
  SELECT name, state_desc, is_in_standby FROM sys.databases WHERE name = 'YourDatabaseName';
  • Note the last successful backup file or transaction log file applied to this database.

Step 2: Restore the Database Using NORECOVERY Instead of STANDBY

  • Stop any active log-shipping jobs or restore scripts targeting this database to avoid conflicts.
  • Run the following T-SQL command to force the database into a restoring state:
  RESTORE DATABASE [YourDatabaseName] WITH NORECOVERY;
  • If you are mid-sequence in a restore chain, re-apply the last transaction log backup using:
  RESTORE LOG [YourDatabaseName] FROM DISK = 'C:\Backups\YourLastLog.trn' WITH NORECOVERY;

Step 3: Complete the Recovery and Allow the Upgrade to Process

  • Once the database is in NORECOVERY state, issue the final recovery command to trigger the upgrade:
  RESTORE DATABASE [YourDatabaseName] WITH RECOVERY;
  • Monitor the SQL Server Error Log (located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG on Windows Server 2025 default installs) for upgrade script progress messages.
  • Allow sufficient time for internal system table upgrades to complete; do not interrupt the SQL Server service during this phase.

Step 4: Reconfigure Log Shipping for Standby Mode (If Required)

  • If Standby mode was required for reporting/read-access purposes, reconfigure the log shipping restore job in SQL Server Agent to use WITH STANDBY only after the initial upgrade-triggering restore has completed with WITH RECOVERY.
  • Update the restore job step properties via SSMS: SQL Server Agent → Jobs → LSRestore[InstanceName][DatabaseName] → Steps → Restore Transaction Log.
  • Ensure subsequent log restores use WITH STANDBY = 'C:\Backups\StandbyUndo\YourDatabaseName.tuf' going forward, since the version upgrade only needs to occur once.

Alternative or Verification Steps

  • Verify the fix by querying sys.databases again and confirming state_desc returns ONLINE (or STANDBY if reconfigured in Step 4) without further error entries in the SQL Server Error Log.
  • If the error persists, check for mismatched SQL Server build numbers between source and destination servers using SELECT @@VERSION; — a full version upgrade patch may be required on the destination instance before the restore can proceed.

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

Troubleshooting Guide: SQL Server Error 3418 – “Recovery Is Unable to Defer Error”

Why This Error Happens

Error 3418 occurs when SQL Server’s recovery process encounters a corrupted or inconsistent page during redo/undo operations and attempts to defer the error for later repair, but the database configuration does not support deferred transactions. This deferral mechanism strictly requires the database to be set to the Full Recovery Model with an unbroken, active transaction log backup chain. If the database is running under the Simple Recovery Model, or if the log chain has been broken (e.g., due to a missed log backup or a recent TRUNCATE LOG operation), SQL Server has no way to defer the corruption and instead throws this critical error, often halting the recovery process entirely.

Step-by-Step Resolution Guide

Step 1: Verify the Current Recovery Model

  • Open SQL Server Management Studio (SSMS) and connect to the instance via the Database Engine.
  • Run the following query to check the current model:
  SELECT name, recovery_model_desc FROM sys.databases WHERE name = 'YourDatabaseName';
  • Confirm if the result shows SIMPLE instead of FULL.

Step 2: Switch to Full Recovery Model (If Applicable)

  • If the database is intended for production use with point-in-time recovery, alter the recovery model:
  ALTER DATABASE YourDatabaseName SET RECOVERY FULL;
  • Immediately take a Full Backup to establish a new baseline, as switching recovery models breaks the existing backup chain.
  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\ (update instance folder name as needed) to verify the backup file writes successfully.

Step 3: Re-establish the Log Backup Chain

  • Since deferred errors require an active log chain, schedule a transaction log backup immediately following the full backup to prevent the log file from growing uncontrollably and to activate the deferral mechanism:
  BACKUP LOG YourDatabaseName TO DISK = 'C:\Backup\YourDatabaseName_Log.trn';
  • If using Windows Server 2025 maintenance plans, verify the SQL Server Agent job for log backups is running under a service account with write permissions to the backup directory.

Step 4: Run DBCC CHECKDB to Address Underlying Corruption

  • Since Error 3418 is triggered by an underlying corruption event, run a consistency check once the database is online and the log chain is active:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for specific page errors (Error 605, 823, or 824) that may need REPAIR_ALLOW_DATA_LOSS in a restored environment.

Alternative or Verification Steps

  • Verification: Re-attempt the operation or database startup that initially triggered Error 3418. If the recovery completes without halting, check the SQL Server Error Log (located in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) to confirm “Recovery is complete” messages with no deferred transaction warnings.
  • Alternative Fix: If switching to Full Recovery is not viable for a Simple Recovery database, the only path to resolve the underlying corruption is to restore the database from the last known good backup rather than relying on the live engine’s deferred recovery process.

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

Troubleshooting Guide: SQL Server Error 3417 – “Cannot Recover the Master Database”

Why This Error Happens

Error 3417 occurs when the SQL Server Database Engine fails to start because the master database is corrupted, missing, or inaccessible during the recovery phase. This is typically caused by damaged master.mdf or mastlog.ldf files, an abrupt system shutdown during a write operation, incorrect file paths in the startup configuration, or insufficient permissions for the SQL Server service account to access the data directory. Since the master database stores all system-level metadata (logins, linked servers, configuration), SQL Server cannot initialize the rest of the instance without it being in a healthy state.

Step-by-Step Resolution Guide

Step 1: Verify Service Account Permissions and File Existence

  • Open Services.msc on Windows Server 2025 / Windows 11 and locate the SQL Server (MSSQLSERVER) service.
  • Confirm the service account has Full Control permissions on the directory C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\.
  • Check that master.mdf and mastlog.ldf physically exist in that directory and are not 0 KB (indicating corruption).

Step 2: Start SQL Server in Single-User/Minimal Mode

  • Open Command Prompt as Administrator.
  • Navigate to the Binn directory: cd "C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Binn".
  • Run the startup command with trace flags to bypass normal recovery: sqlservr.exe -c -m -T3608.
  • This starts SQL Server using only the master database, preventing it from attempting to recover tempdb or user databases simultaneously.

Step 3: Restore Master from a Known Good Backup

  • Open a new Command Prompt window (keep the previous one running) and connect via sqlcmd -S localhost -E.
  • Execute the restore command, pointing to your last known good full backup:
  RESTORE DATABASE master FROM DISK = 'C:\Backups\master.bak' WITH REPLACE;
  • Allow the instance to restart automatically; SQL Server will shut down the minimal instance and apply the restored files.

Step 4: Rebuild System Databases (If No Backup Exists)

  • If a valid backup is unavailable, run the Setup.exe utility from your SQL Server 2025 installation media.
  • Use the /ACTION=REBUILDDATABASE parameter alongside /INSTANCENAME and /SQLSYSADMINACCOUNTS to generate fresh, default system databases.
  • Note: This action resets master to default, erasing custom logins and linked server configs, which must be reconfigured manually afterward.

Alternative or Verification Steps

  • Verify the Fix: Check the SQL Server Error Log (located in the LOG folder of the instance directory) for the message “SQL Server is now ready for client connections,” confirming a clean startup.
  • Alternative: If physical restoration fails, detach the drive and use a tool like DBCC CHECKDB in Emergency Mode on a copy of the database to extract data before rebuilding the instance from scratch.

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

Troubleshooting Guide: Error 3415 — Database Cannot Be Upgraded Because It Is Read-Only

Why This Error Happens

This error occurs when SQL Server 2025 attempts to run an internal upgrade script against a database during startup or attach, but the database is flagged as READ_ONLY and the engine cannot write the version/schema changes required. This commonly happens after restoring a database from an older SQL Server version, attaching a read-only file from a SAN snapshot or NAS share, or when the underlying data files have read-only NTFS attributes set at the filesystem level. It can also occur if the database was intentionally set to read-only for reporting/archival purposes and was never switched back before applying a Cumulative Update or version upgrade.

Step-by-Step Resolution Guide

Step 1: Verify the Current Database State

  • Open SQL Server Management Studio (SSMS) or run a query via sqlcmd.
  • Execute the following to check the current read-only status:
  SELECT name, is_read_only, state_desc 
  FROM sys.databases 
  WHERE name = 'YourDatabaseName';
  • Confirm is_read_only returns 1 before proceeding.

Step 2: Check and Remove Filesystem-Level Read-Only Attributes

  • Navigate to the default data directory, typically: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\
  • Right-click the .mdf and .ldf files for the affected database, select Properties, and uncheck Read-only if present.
  • Alternatively, run this from an elevated Command Prompt:
  attrib -r "C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\YourDatabase.mdf"
  attrib -r "C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\YourDatabase_log.ldf"

Step 3: Set the Database to READ_WRITE Mode

  • Ensure no active connections are using the database before changing its state.
  • Run the following T-SQL command to force single-user mode and switch the state:
  ALTER DATABASE [YourDatabaseName] SET READ_WRITE WITH ROLLBACK IMMEDIATE;
  • If the database resides on a read-only mount point (e.g., a SAN snapshot LUN), remount the volume with read-write permissions in Disk Management on Windows Server 2025 before re-running the command.

Step 4: Restart the SQL Server Service to Trigger the Upgrade Script

  • Open SQL Server Configuration Manager.
  • Right-click SQL Server (MSSQLSERVER) and select Restart to allow the pending internal upgrade scripts to complete against the now-writable database.
  • Monitor the SQL Server Error Log located at: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for successful upgrade completion messages.

Alternative or Verification Steps

  • Re-run the verification query from Step 1; is_read_only should now return 0, and the database state_desc should show ONLINE.
  • If the database must remain read-only for business reasons (e.g., a reporting replica), perform the upgrade on a read-write copy first, then re-apply the READ_ONLY flag only after the upgrade script has successfully completed.

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

Troubleshooting Guide: SQL Server Error 3416 – Read-Only Files Preventing Recollation

Why This Error Happens

This error occurs when SQL Server attempts to change the server-level collation, but one or more of its database files (MDF, NDF, or LDF) are marked as read-only at the file system level. The recollation process requires full write access to every data and log file associated with every database—including system databases—because it must rebuild metadata and system tables to reflect the new collation. This is commonly caused by files residing on a read-only volume, incorrect NTFS permissions, a file attribute flag set to “Read-only,” or databases that were restored from a read-only backup source or SAN snapshot.

Step-by-Step Resolution Guide

Step 1: Identify All Read-Only Database Files

  • Open File Explorer or PowerShell and navigate to your SQL Server data directory (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA).
  • Run the following PowerShell command to scan for read-only attributes:
  Get-ChildItem -Path "C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA" -Recurse | Where-Object { $_.IsReadOnly -eq $true }
  • Note every .mdf, .ndf, and .ldf file returned, including those for master, model, msdb, and tempdb.

Step 2: Remove the Read-Only Attribute from Files

  • Right-click each flagged file, select Properties, and uncheck the Read-only box under the General tab.
  • Alternatively, clear the attribute in bulk via PowerShell (run as Administrator):
  Get-ChildItem -Path "C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA" -Recurse | Set-ItemProperty -Name IsReadOnly -Value $false
  • If files reside on a mapped network drive or SAN volume, confirm the underlying volume itself is not mounted as read-only (diskpart → list volume → check Read-only status).

Step 3: Verify NTFS Permissions for the SQL Server Service Account

  • Open Properties > Security on the DATA folder and confirm the SQL Server service account (e.g., NT Service\MSSQLSERVER or a custom domain account) has Full Control.
  • If permissions are missing, click Edit > Add, enter the service account name, and grant Full Control to the folder and all subfolders/files.
  • Apply changes recursively and allow propagation to complete before proceeding.

Step 4: Restart the SQL Server Service and Retry Recollation

  • Open SQL Server Configuration Manager, right-click the SQL Server (MSSQLSERVER) service, and select Restart.
  • Reattempt the collation change using Setup.exe with the /ACTION=REBUILDDATABASE parameter and the correct /SQLCOLLATION value, or re-run the original recollation command/script.

Alternative or Verification Steps

  • After restarting the service, re-run the Get-ChildItem ... IsReadOnly PowerShell check from Step 1 to confirm zero files are flagged read-only, then retry the collation change to confirm Error 3416 no longer appears.
  • If the error persists, detach the affected database, manually copy its files to a fresh writable directory with inherited permissions, and reattach before retrying the recollation process.

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

Troubleshooting Guide: SQL Server Error 3414 — “An Error Occurred During Recovery”

Why This Error Happens

Error 3414 occurs when SQL Server 2025 cannot successfully complete the recovery phase during database startup, typically because the transaction log is corrupted, truncated, or missing, preventing the engine from rolling back incomplete transactions or rolling forward committed ones. This can also stem from abrupt shutdowns, storage-level corruption, or a mismatch between the data (.mdf) and log (.ldf) files caused by improper file restoration. In some cases, insufficient permissions on the SQL Server service account for the database files can also trigger this failure during the recovery process.

Step-by-Step Resolution Guide

Step 1: Check the SQL Server Error Log for Root Cause

  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG to review the detailed recovery failure messages.
  • Look for accompanying errors such as 823, 824, or 9001, which indicate I/O or log corruption specifics.
  • Identify the exact database name and file path referenced in the stack trace.

Step 2: Attempt to Bring the Database Online in Emergency Mode

  • Open SQL Server Management Studio (SSMS) or sqlcmd and run:
  • ALTER DATABASE [YourDB] SET EMERGENCY;
  • ALTER DATABASE [YourDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • DBCC CHECKDB([YourDB], REPAIR_ALLOW_DATA_LOSS);
  • Note that this step may result in data loss, so only proceed if no clean backup is available.

Step 3: Restore from a Known Good Backup

  • Locate the most recent full backup and subsequent transaction log backups.
  • Use the RESTORE DATABASE [YourDB] FROM DISK = 'D:\Backups\YourDB.bak' WITH NORECOVERY; command.
  • Apply log backups sequentially using RESTORE LOG with WITH RECOVERY on the final file.

Step 4: Verify File System and Service Account Permissions

  • Confirm the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control on the data and log directories (typically D:\SQLData and L:\SQLLogs).
  • Check Windows Server 2025 Event Viewer under Windows Logs > System for disk-related warnings (Event ID 153 or 129) that may indicate underlying storage issues.
  • Run chkdsk D: /f during a maintenance window if disk corruption is suspected.

Step 5: Rebuild the Database if Repair Fails

  • As a last resort, detach the corrupted database using sp_detach_db.
  • Create a new database with the same file structure and import data from the last viable backup or export.
  • Re-attach using sp_attach_db only after confirming file integrity with DBCC CHECKDB.

Alternative or Verification Steps

  • After recovery, run DBCC CHECKDB([YourDB]) WITH NO_INFOMSGS; to confirm there is no remaining corruption and the database is fully consistent.
  • If the database still fails to recover, consider restoring to a new SQL Server 2025 instance on a separate Windows Server 2025 VM to isolate whether the issue is storage-hardware related or software-specific.

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

Troubleshooting Guide: Error 3413 – Could Not Mark Database as Suspect (Getnext NC Scan Failed on sys.databases.database_id)

Why This Error Happens

Error 3413 occurs when SQL Server 2025 attempts to transition a database into the SUSPECT state but fails because the internal metadata scan on the sys.databases.database_id non-clustered index cannot complete successfully. This typically indicates corruption in the system catalog, a damaged master database, or severe I/O-level disruption that prevents SQL Server from reliably reading its own internal database registry. In most cases, this error is a secondary symptom—the root cause is usually an earlier, more fundamental failure (such as a torn page, disk failure, or storage timeout) that is logged separately in the SQL Server Error Log just before this message appears.

Step-by-Step Resolution Guide

Step 1: Review the Full SQL Server Error Log for the Root Cause

  • Open SQL Server Management Studio (SSMS) and navigate to Management > SQL Server Logs, or review the raw log file at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Look for errors immediately preceding Error 3413, such as Error 823, 824, or 825 (I/O errors), which usually point to the actual underlying storage or corruption issue.
  • Note the specific database_id referenced in the error to identify which user database triggered the failure.

Step 2: Check Storage Health and Windows Event Viewer

  • Open Event Viewer on Windows Server 2025 / Windows 11 and inspect the System and Application logs under Windows Logs for Disk, NTFS, or storage controller warnings.
  • Run chkdsk C: /f /r (adjust drive letter to match your data/log file volume) during a scheduled maintenance window to repair file system-level corruption.
  • Verify that the underlying storage (SAN, local disk, or virtual disk) is not reporting latency spikes or hardware faults using Windows Performance Monitor (PerfMon) counters like Avg. Disk sec/Read and Avg. Disk sec/Write.

Step 3: Run Integrity Checks on the Master Database

  • Stop non-essential workloads and run the following in SSMS or sqlcmd:
  DBCC CHECKDB ('master') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is found in master, you may need to restart SQL Server in single-user mode using sqlservr.exe -m from an elevated Command Prompt and rebuild system databases using setup.exe /ACTION=REBUILDDATABASE from the SQL Server 2025 installation media if repair is not possible.

Step 4: Run DBCC CHECKDB on the Affected User Database

  • Once master is confirmed healthy, run integrity checks against the database ID flagged in the error:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is detected, restore from the most recent verified backup rather than using REPAIR_ALLOW_DATA_LOSS, unless no valid backup exists.

Step 5: Restart the SQL Server Service and Monitor

  • Restart the SQL Server (MSSQLSERVER) service via services.msc or by running:
  Restart-Service -Name 'MSSQLSERVER' -Force
  • Monitor the Error Log closely for 24–48 hours to confirm Error 3413 does not recur, especially during high I/O periods like index maintenance or backup jobs.

Alternative or Verification Steps

  • Confirm resolution by querying sys.databases directly (SELECT name, state_desc FROM sys.databases;) to ensure all databases show ONLINE status with no residual SUSPECT entries.
  • If the error persists after storage and integrity checks, engage Microsoft Support with the full Error Log and a DBCC CHECKDB output, as this may indicate a deeper SQL Server Engine-level bug requiring a Cumulative Update or hotfix.

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

Troubleshooting Guide: SQL Server Error 3412 (Minimal Configuration Startup Warning)

Why This Error Happens

This warning occurs because SQL Server 2025 was started with the -f (minimal configuration) startup parameter, either manually by an administrator or automatically by the SQL Server Configuration Manager after a previous startup failure. This flag forces the instance into single-user mode and bypasses most configurable settings (like memory allocation and extended procedures) to allow access for emergency repairs. It typically appears after a DBA has intentionally used this mode to fix a misconfigured setting (such as an invalid max server memory value) that was preventing normal startup.

Step-by-Step Resolution Guide

Step 1: Identify Why Minimal Configuration Was Used

  • Open the SQL Server Error Log (usually located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) to check the events immediately preceding this warning.
  • Look for Event ID 17148 or specific configuration errors that may have triggered the original failure requiring the -f flag.

Step 2: Connect and Correct the Faulty Configuration

  • Since the instance is in single-user mode, connect immediately via SQLCMD (GUI tools like SSMS may consume the single connection slot via background processes).
  • Run the following command in a Command Prompt (Run as Administrator):
sqlcmd -S localhost -E
  • Identify the specific sp_configure value that caused the initial crash (e.g., incorrect memory settings) and reset it to a valid value:
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'max server memory', 2147483647;
RECONFIGURE;

Step 3: Remove the Startup Parameter

  • Open SQL Server Configuration Manager (search for SQLServerManager17.msc on Windows 11/Server 2025).
  • Navigate to SQL Server Services, right-click your instance, and select Properties.
  • Go to the Startup Parameters tab and remove the -f flag from the list if it was manually added for a persistent fix.
  • Click Apply.

Step 4: Restart the SQL Server Service

  • Restart the service normally through the Services console (services.msc) or Configuration Manager to exit single-user mode.
  • Verify the instance starts without needing the -m or -f flags.

Alternative or Verification Steps

  • Verification: Check the Error Log again after the restart; the warning should be absent, and the log should state the server is ready for client connections without “single-user mode” restrictions.
  • Alternative: If the server fails to start normally after removing the flag, the configuration change in Step 2 did not save correctly; repeat the process using the -m (single-user, allows background services) flag instead of -f to isolate the specific sp_configure value causing the fault.

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

Troubleshooting Guide: SQL Server Error 3411 – Invalid Configuration Block Version

Why This Error Happens

Error 3411 occurs when the configuration block at the start of the master database is corrupted or contains an unrecognized version number, preventing SQL Server from validating the database structure during startup. This typically results from an improper shutdown, disk-level corruption, a failed SQL Server upgrade, or storage hardware issues that damaged the master database file before SQL Server could cleanly flush its state. Because the master database stores critical system-level configuration data, SQL Server refuses to start to prevent further data integrity issues.

Step-by-Step Resolution Guide

Step 1: Verify the Scope of Corruption

  • Check the SQL Server Error Log located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for the exact point of failure.
  • Confirm whether the error references master.mdf or mastlog.ldf specifically.
  • Check Windows Event Viewer under Windows Logs > System for underlying disk or storage controller errors (Event ID 7 or 11) that may have caused the corruption.

Step 2: Start SQL Server in Single-User Minimal Configuration Mode

  • Open Command Prompt as Administrator and stop the SQL Server service:
    net stop MSSQLSERVER
  • Start the SQL Server instance manually using the -f (minimal configuration) and -m (single-user) startup parameters:
    NET START MSSQLSERVER /f /m"SQLCMD"
  • If the service starts successfully in this mode, it confirms the master database header is readable but the configuration block itself is still flagged as invalid.

Step 3: Rebuild the Master Database

  • If Step 2 fails or the configuration remains invalid, you must rebuild the system databases using the installation media.
  • Navigate to the SQL Server setup directory (usually D:\ or the mounted ISO location) and run the following command via Command Prompt:
    Setup.exe /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=MSSQLSERVER /SQLSYSADMINACCOUNTS=BUILTIN\Administrators /SAPWD=<StrongPassword>
  • This resets master, model, and msdb to their default state, effectively clearing the corrupted configuration block.

Step 4: Restore Master from a Valid Backup

  • If you have a recent backup of the master database, restart the SQL Server instance in single-user mode (sqlservr.exe -m) via Command Prompt.
  • Connect via SQLCMD and execute:
    RESTORE DATABASE master FROM DISK = 'C:\Backup\master.bak' WITH REPLACE;
  • Allow the service to restart automatically once the restore operation completes to reload the valid configuration block.

Alternative or Verification Steps

  • Verification: After the service starts successfully, run SELECT @@VERSION; in SQL Server Management Studio (SSMS) to confirm the instance is fully operational and attach any user databases to verify they mount correctly.
  • Alternative: If no backup exists and the rebuild fails due to persistent disk errors, run CHKDSK C: /F /R via an elevated Command Prompt to repair the underlying file system before re-attempting the SQL Server installation repair.

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

Troubleshooting Guide: SQL Server Error 3409 — Performance Counter Shared Memory Setup Failed

Why This Error Happens

Error 3409 occurs when SQL Server 2025 cannot initialize the shared memory segment used by Windows Performance Monitor counters, typically because the registry performance counter strings are corrupted or out of sync with the sqlctr.ini/sqlctr.xml definition files. This can also happen if the SQL Server service account lacks the necessary registry permissions under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<InstanceID>\Performance, or if a prior failed install/patch left orphaned or mismatched counter DLL references. In some cases, third-party monitoring agents or antivirus software lock the shared memory handles, preventing SQL Server from registering its counters at startup.

Step-by-Step Resolution Guide

Step 1: Verify and Repair Registry Permissions

  • Open regedit and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<InstanceID>\Performance.
  • Right-click the key, select Permissions, and confirm the SQL Server service account has Full Control.
  • If the key is missing entirely, this confirms counter registration never completed and you must proceed to reinstalling the counters (Step 2).

Step 2: Unload and Reload Performance Counters

  • Open an elevated Command Prompt and navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.<InstanceID>\MSSQL\Binn\.
  • Unload the existing (potentially corrupted) counters: unlodctr MSSQL$<InstanceID> (or unlodctr MSSQLSERVER for default instance).
  • Reload the counters using the instance-specific .ini file: lodctr sqlctr.ini.
  • Restart the SQL Server () service via services.msc or net stop/start.

Step 3: Rebuild the Entire Performance Counter Library (if Step 2 fails)

  • Run lodctr /R from an elevated prompt to rebuild the full counter registry from stored INI definitions across all installed applications.
  • If corruption is severe, run exctrlst.exe (Extensible Counter List) to confirm MSSQL$<InstanceID> appears as “Active” with no error flags.
  • As a last resort, re-run SQL Server Setup → Repair for the affected instance to force regeneration of sqlctr.ini and re-register the performance DLL (sqlctr160.dll or newer).

Step 4: Check for File System or Antivirus Interference

  • Confirm sqlctr.ini exists in the Binn directory and is not flagged as read-only or quarantined by antivirus.
  • Add an exclusion for the SQL Server Binn directory in Windows Defender or your third-party AV product.
  • Re-attempt Step 2 after clearing any file locks (use Process Explorer to confirm no process is holding a handle on sqlctr.ini).

Alternative or Verification Steps

  • Open Performance Monitor (perfmon.exe), click Add Counter, and confirm SQLServer:General Statistics (or your instance-specific object) appears in the list without errors — this confirms the shared memory segment is functioning.
  • If the error persists after a full repair, check the SQL Server Error Log and Windows Application Event Log for correlating Event ID 3409 timestamps to rule out concurrent WMI provider or Resource Monitor conflicts, then consider rebuilding the instance’s performance DLLs via a full uninstall/reinstall of that feature component.

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

Troubleshooting Guide: SQL Server Error 3410 – “Data in filegroup %s is offline”

Why This Error Happens

This error occurs when SQL Server marks a filegroup as OFFLINE, typically due to a failed or interrupted database recovery process affecting one or more data files within that filegroup. It can also result from missing, corrupted, or inaccessible physical data files (.ndf/.mdf) on the Windows Server 2025 or Windows 11 file system, often caused by disk failures, improper shutdowns, or permission issues for the SQL Server service account. Additionally, restoring a database without including all filegroups, or attempting operations on a filegroup that failed during an autogrow operation, can trigger this state.

Step-by-Step Resolution Guide

Step 1: Verify Filegroup and File Status

  • Run the following query to identify the affected filegroup and file state:
  SELECT name, state_desc, physical_name 
  FROM sys.master_files 
  WHERE database_id = DB_ID('YourDatabaseName');
  • Check Windows Event Viewer (Event Viewer > Windows Logs > Application) for related I/O or disk errors correlating with the SQL Server error log timestamp.
  • Locate the SQL Server error log via C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\ERRORLOG to confirm the exact file path reported as offline.

Step 2: Check File System and Permissions

  • Navigate to the physical file location (e.g., D:\SQLData\YourDB_Data2.ndf) and confirm the file exists and is not corrupted or renamed.
  • Right-click the file/folder, go to Properties > Security, and ensure the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control permissions.
  • If the underlying disk or volume is disconnected (common in virtualized Windows Server 2025 setups), remount the volume using Disk Management (diskmgmt.msc) and ensure the drive letter matches the path in sys.master_files.

Step 3: Bring the Filegroup Back Online

  • If the file is present and accessible, attempt to bring the database online, which should also recover the filegroup:
  ALTER DATABASE YourDatabaseName SET ONLINE;
  • If only the secondary filegroup is offline, try restoring just that filegroup from a valid backup:
  RESTORE DATABASE YourDatabaseName 
  FILEGROUP = 'YourFilegroupName' 
  FROM DISK = 'D:\Backups\YourDB.bak' 
  WITH NORECOVERY;
  RESTORE LOG YourDatabaseName FROM DISK = 'D:\Backups\YourDB_log.trn' WITH RECOVERY;

Step 4: Rebuild or Replace Missing Data Files (If File is Lost)

  • If the physical file is permanently lost or corrupted beyond repair, use emergency mode repair as a last resort:
  ALTER DATABASE YourDatabaseName SET EMERGENCY;
  DBCC CHECKDB (YourDatabaseName, REPAIR_ALLOW_DATA_LOSS);
  • Note this may result in data loss for objects stored in that specific filegroup.

Alternative or Verification Steps

  • Verify the fix by re-running SELECT state_desc FROM sys.database_files; to confirm the filegroup now shows ONLINE instead of OFFLINE.
  • If the restore process fails due to backup corruption, use RESTORE VERIFYONLY FROM DISK = 'D:\Backups\YourDB.bak' to validate backup integrity before attempting the restore again.

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

Troubleshooting Guide: SQL Server Error 3408

Why This Error Happens

Error 3408 is a benign, informational message generated by the SQL Server Database Engine during the startup or restart process. It simply indicates that the database recovery phase—where SQL Server rolls forward committed transactions and rolls back uncommitted ones from the transaction log—has finished successfully. This message is logged purely for diagnostic visibility and does not indicate a failure, corruption, or misconfiguration; however, if it appears unexpectedly alongside long recovery times or follows an unclean shutdown, it may warrant a closer look at underlying disk I/O or transaction log health.

Step-by-Step Resolution Guide

Step 1: Confirm the Message Context in the SQL Server Error Log

  • Open SQL Server Management Studio (SSMS) and navigate to Management > SQL Server Logs.
  • Alternatively, review the raw log file located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Confirm that Error 3408 is immediately preceded by “Starting up database ‘‘” and followed by “Recovery is complete” with no accompanying error codes (such as 824 or 9001).

Step 2: Check for Signs of an Unclean Shutdown

  • Review Windows Event Viewer under Windows Logs > System for Event ID 6008 (unexpected shutdown) or 41 (Kernel-Power, indicating a dirty reboot).
  • If an unclean shutdown is confirmed, this explains why SQL Server had to perform crash recovery (rolling back open transactions), which triggers this informational message.
  • Check sys.dm_os_sys_info or Task Manager to rule out memory pressure or resource exhaustion that may have caused the prior service interruption.

Step 3: Validate Transaction Log Health and Disk Performance

  • Run DBCC SQLPERF(LOGSPACE); to ensure the transaction log for the affected database is not critically full, as a full log can extend recovery time.
  • Check disk latency using Performance Monitor (PerfMon) with the counter Avg. Disk sec/Transfer on the volume hosting your .ldf files; values consistently above 20ms indicate a storage bottleneck.
  • If recovery took an unusually long time, consider moving the transaction log to a faster disk (e.g., NVMe SSD) or increasing the recovery interval (min) configuration if this is a large OLTP database.

Step 4: Suppress or Filter Informational Noise (Optional)

  • If this message is cluttering your log monitoring or alerting system (e.g., SCOM or a custom monitoring script), update your log parser to explicitly ignore Severity Level 10 messages with Error 3408.
  • Do not attempt to disable trace flags to suppress this specific message, as it is a core part of SQL Server’s standard recovery logging and should remain visible for audit purposes.

Alternative or Verification Steps

  • Verify Success: Run SELECT state_desc FROM sys.databases WHERE name = '<YourDatabaseName>'; and confirm the state reads ONLINE. If the state shows “RECOVERY_PENDING” or “SUSPECT” instead, Error 3408 did not actually complete successfully, and you should investigate hardware/storage errors immediately.
  • Alternative Check: If recovery times are consistently slow, run DBCC CHECKDB during a maintenance window to rule out underlying page-level corruption that might be forcing longer rollback/roll-forward cycles during every restart.

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

Troubleshooting Guide: SQL Server Error 3407 – Transactions Rolled Back During Recovery

Why This Error Happens

Error 3407 is generated during the database recovery process when SQL Server rolls back incomplete transactions that were active at the time of a shutdown, crash, or failover. This typically occurs after an unexpected service interruption, a failed cluster failover, or when a database was not shut down cleanly (e.g., power loss or forced termination of the sqlservr.exe process). While the message itself is informational, its frequent appearance may point to underlying instability such as storage I/O latency, insufficient transaction log space, or hardware-level disk corruption on Windows Server 2025 volumes.

Step-by-Step Resolution Guide

Step 1: Confirm the Informational Nature of the Message

  • Check the SQL Server Error Log via SSMS: Management > SQL Server Logs > Current.
  • Verify the message is paired with “Recovery is complete” shortly after, confirming normal rollback behavior.
  • Run: EXEC xp_readerrorlog 0, 1, N'3407'; to isolate occurrences.

Step 2: Investigate the Root Cause of the Unexpected Shutdown

  • Open Event Viewer (eventvwr.msc) on Windows Server 2025 and inspect the System and Application logs around the timestamp of the error.
  • Look for Event ID 6008 (unexpected shutdown) or Event ID 41 (kernel power event).
  • Check for Windows Updates or automatic reboots scheduled via Settings > Windows Update > Advanced Options.

Step 3: Validate Transaction Log Health and Storage Integrity

  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to rule out corruption.
  • Inspect the drive hosting your .ldf files for latency using Performance Monitor (perfmon) and the Avg. Disk sec/Write counter.
  • Ensure the log file has adequate auto-growth settings: ALTER DATABASE YourDatabaseName MODIFY FILE (NAME = YourDB_log, FILEGROWTH = 512MB);

Step 4: Review SQL Server and Windows Cluster Failover Settings

  • If running on a Failover Cluster Instance (FCI) or Always On Availability Group, check the Failover Cluster Manager for recent automatic failover events.
  • Validate the HealthCheckTimeout and LeaseTimeout properties in the AG resource properties to prevent false-positive failovers causing rollback.

Alternative or Verification Steps

  • To verify resolution, monitor the SQL Server Error Log over the next maintenance cycle to ensure Error 3407 only appears in correlation with planned restarts (e.g., patching), not unexpected crashes.
  • If rollbacks continue without a clear trigger, run a memory diagnostic via mdsched.exe and check physical disk SMART status, as this message can be a downstream symptom of failing hardware rather than a SQL Server configuration issue.

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

Troubleshooting Guide: SQL Server Error 3406 — “%d transactions rolled forward in database ‘%.*ls’ (%d:%d)”

Why This Error Happens

This message appears during the REDO phase of database recovery, when SQL Server replays (rolls forward) committed transactions from the transaction log to bring the database back to a consistent state after a restart, failover, or crash. It is logged as part of normal crash recovery or when a database transitions out of RESTORING/SUSPECT state, and is not an indicator of corruption or failure by itself. However, if it appears unexpectedly or repeatedly, it may point to an underlying issue such as an unclean shutdown, storage I/O interruption, or an Availability Group failover forcing redo on the secondary replica.

Step-by-Step Resolution Guide

Step 1: Confirm the Message Is Informational Only

  • Check the SQL Server Error Log via EXEC sp_readerrorlog; or open it directly from C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Verify Error 3406 is immediately followed by messages like “Recovery is complete” and no severity 16+ errors are logged alongside it.
  • If no further errors follow, treat this as an informational log entry generated during routine recovery — no action required.

Step 2: Investigate the Root Cause of the Restart or Failover

  • Check Windows Event Viewer under Windows Logs > System for unexpected shutdowns, power events, or storage driver errors around the timestamp of the message.
  • Review SQL Server Error Log for prior entries such as “The log for database ‘%s’ is not available” or “SQL Server is terminating” to identify if the restart was crash-induced or planned.
  • If using Always On Availability Groups, check AG Dashboard in SSMS or sys.dm_hadr_database_replica_states to confirm if a failover triggered the redo.

Step 3: Validate Disk and Storage Health

  • Run chkdsk C:\ /f (or the relevant data/log drive) on Windows Server 2025 to rule out underlying disk corruption.
  • Check Storage Spaces Direct (S2D) or SAN multipath logs if running on clustered Windows Server 2025 infrastructure, as transient I/O timeouts often precede forced recovery.
  • Use sqlcmd -Q "DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;" to confirm database integrity post-recovery.

Step 4: Monitor Transaction Log Growth and VLF Count

  • Excessive rolled-forward transactions can indicate a transaction log that is too large or has high VLF (Virtual Log File) fragmentation, slowing recovery time.
  • Run DBCC LOGINFO('YourDatabaseName'); to review VLF count; if it exceeds 1,000, consider shrinking and regrowing the log in fixed increments via ALTER DATABASE ... MODIFY FILE.
  • Set log file autogrowth to a fixed MB value (e.g., 512MB) instead of a percentage to prevent fragmentation going forward.

Alternative or Verification Steps

  • Confirm the database is online and healthy by running SELECT name, state_desc FROM sys.databases WHERE name = 'YourDatabaseName'; — state should read ONLINE.
  • If Error 3406 recurs frequently without a clear restart/failover trigger, enable trace flag 3004 and 3605 temporarily to get more verbose recovery logging, and escalate to Microsoft CSS if paired with any 823/824 I/O errors.

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

Troubleshooting Guide: SQL Server Error 3404 – “Failed to Check for New Installation or Renamed Server at Startup”

Why This Error Happens

This error occurs when SQL Server 2025 attempts to validate the server’s identity against the registry and machine name during startup, but the logic fails due to corrupted registry keys or mismatched server name metadata. It is commonly triggered after a server rename, a failed cluster failover, or domain/workgroup changes that leave stale entries in the SQL Server Configuration Manager or Windows registry. Insufficient permissions on the registry hive or a corrupted sys.servers system catalog can also prevent SQL Server from completing this internal validation check.

Step-by-Step Resolution Guide

Step 1: Verify Server Name Consistency

  • Open a Command Prompt as Administrator and run hostname to get the current Windows machine name.
  • Connect to SQL Server via SQLCMD or SSMS and run SELECT @@SERVERNAME; and SELECT SERVERPROPERTY('ServerName');.
  • If the values do not match, this mismatch is the root cause of the Error 3404 logic failure.

Step 2: Drop and Re-Add the Server Name

  • In SSMS, execute sp_dropserver 'OldServerName'; to remove the stale registration.
  • 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.

Step 3: Check Registry Permissions and Integrity

  • Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL17.MSSQLSERVER\Setup in Registry Editor (regedit).
  • Confirm the SQLServerName and ComputerNamePhysicalNetBIOS values match the actual host name.
  • Ensure the NT AUTHORITY\SYSTEM and SQLServerMSSQLUser$<InstanceName> accounts have Full Control permissions on this registry key.

Step 4: Repair the SQL Server Installation

  • Launch the SQL Server 2025 Installation Center from the original setup media or ISO.
  • Select Maintenance > Repair and choose the affected instance.
  • Allow the repair wizard to complete, then reboot the Windows Server 2025 / Windows 11 machine before attempting to start the SQL Server service again.

Alternative or Verification Steps

  • After applying fixes, restart the SQL Server service and check the SQL Server Error Log (ERRORLOG file in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\) to confirm Error 3404 no longer appears during startup.
  • If the issue persists, use sp_helpserver to inspect server metadata directly, or as a last resort, uninstall and perform a clean reinstall of the SQL Server instance to rebuild the corrupted setup logic.

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

Troubleshooting Guide: SQL Server Error 3403 – “Recovering only master database because traceflag 3608 was specified”

Why This Error Happens

This message appears when SQL Server 2025 is started with trace flag 3608 enabled, either manually via startup parameters or inherited from a previous troubleshooting session. Trace flag 3608 deliberately instructs the SQL Server Database Engine to skip the automatic recovery process for all user databases, recovering only the master database to speed up startup. While this is an informational message and not a true error, it often causes confusion when administrators notice that user databases remain in a “Recovery Pending” or inaccessible state after the service starts, mistaking normal behavior for database corruption.

Step-by-Step Resolution Guide

Step 1: Verify the Intent Behind the Trace Flag

  • Confirm whether trace flag 3608 was intentionally added for maintenance tasks (such as moving tempdb or performing manual recovery).
  • Check the SQL Server Error Log located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for the exact startup parameters used.
  • Look for the line referencing -T3608 in the startup sequence to validate its presence.

Step 2: Remove the Trace Flag from Startup Parameters

  • Open SQL Server Configuration Manager on Windows Server 2025 or Windows 11.
  • Navigate to SQL Server Services > right-click SQL Server (MSSQLSERVER) > select Properties.
  • Go to the Startup Parameters tab and locate the entry -T3608.
  • Select the flag and click Remove, then click Apply.

Step 3: Restart the SQL Server Service

  • Restart the service via Configuration Manager or run the following in an elevated PowerShell terminal:
  • Restart-Service -Name 'MSSQLSERVER' -Force
  • Monitor the ERRORLOG file in real-time to ensure databases proceed through the standard recovery phases (Analysis, Redo, Undo).

Step 4: Manually Bring User Databases Online

  • If databases remain in a “Recovery Pending” state after removing the flag, execute the following T-SQL command for each affected database:
  • ALTER DATABASE [YourDatabaseName] SET ONLINE;
  • Review sys.databases to check the state_desc column for confirmation of status changes.

Alternative or Verification Steps

  • Run SELECT name, state_desc FROM sys.databases; in SSMS to confirm all user databases show a state_desc of ONLINE rather than RECOVERY_PENDING.
  • If the trace flag was required for a specific administrative task (e.g., tempdb relocation), ensure it is used only temporarily via DBCC TRACEOFF (3608, -1) immediately after the task is complete, rather than leaving it as a persistent startup parameter.

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

Troubleshooting Guide: SQL Server Error 3402

Why This Error Happens

Error 3402 occurs when SQL Server attempts to run recovery on a database that is in a state incompatible with the recovery process, such as SUSPECT, OFFLINE, EMERGENCY, or RESTORING. This typically happens because a previous recovery attempt failed due to corrupted transaction log files, abrupt shutdowns, or storage-level I/O errors that left the database in an inconsistent state. It can also occur if a restore sequence was interrupted or if the database files are marked read-only at the OS level while SQL Server expects write access.

Step-by-Step Resolution Guide

Step 1: Verify the Current Database State

  • Open SQL Server Management Studio (SSMS) or a query window and run:
    SELECT name, state_desc FROM sys.databases WHERE name = 'YourDBName';
  • Confirm whether the state is SUSPECT, RESTORING, OFFLINE, or EMERGENCY.
  • Check the SQL Server Error Log (default path: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for related messages preceding Error 3402.

Step 2: Place the Database in EMERGENCY Mode

  • Run the following to allow limited access for diagnostics:
    ALTER DATABASE YourDBName SET EMERGENCY;
  • This bypasses normal recovery and allows read-only access to assess damage.
  • Confirm the database is now accessible via sp_helpdb YourDBName.

Step 3: Run Consistency Checks and Repair

  • Set the database to single-user mode to avoid conflicts:
    ALTER DATABASE YourDBName SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • Run a full integrity check:
    DBCC CHECKDB ('YourDBName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is confirmed, apply the repair option:
    DBCC CHECKDB ('YourDBName', REPAIR_ALLOW_DATA_LOSS);
  • Return the database to multi-user mode once repairs complete:
    ALTER DATABASE YourDBName SET MULTI_USER;

Step 4: Validate File Permissions and Disk Health

  • Navigate to the data/log file directory (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).
  • Ensure the SQL Server service account has Full Control permissions on the .mdf and .ldf files.
  • Run chkdsk C: /f /r on Windows Server 2025 to rule out underlying disk corruption, then restart the SQL Server service.

Step 5: Restore from Backup if Repair Fails

  • If DBCC CHECKDB cannot resolve the issue, restore the database from the last known good backup:
    RESTORE DATABASE YourDBName FROM DISK = 'D:\Backups\YourDBName.bak' WITH RECOVERY;
  • Apply any available transaction log backups in sequence to minimize data loss.

Alternative or Verification Steps

  • After recovery, run SELECT state_desc FROM sys.databases WHERE name = 'YourDBName'; and confirm the state reads ONLINE.
  • If the issue persists after repair attempts, detach the database (sp_detach_db) and re-attach it using CREATE DATABASE ... FOR ATTACH to force SQL Server to re-evaluate file headers and metadata.

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

Troubleshooting Guide: SQL Server Error 3401

Why This Error Happens

Error 3401 occurs when SQL Server’s recovery process encounters a database page or transaction log record that is physically corrupted, preventing a proper rollback of an incomplete transaction. This is commonly caused by underlying storage issues (disk failures, SAN/RAID controller faults, or improper shutdowns) that corrupt data pages before SQL Server can flush them correctly. Because the transaction cannot be rolled back cleanly, SQL Server defers the recovery and marks the affected page or file as suspect, requiring manual intervention to restore consistency.

Step-by-Step Resolution Guide

Step 1: Identify the Corrupted Page or File

  • Check the SQL Server Error Log (via SQL Server Management Studio > Management > SQL Server Logs, or C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the specific Page ID and File ID referenced alongside Error 3401.
  • Run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to get a full list of corrupted objects and confirm the scope of damage.
  • Note whether the corruption affects a single page, an index, or the entire file structure.

Step 2: Take the Database Offline Safely

  • Prevent further writes to the corrupted file by setting the database to single-user or restricted mode:
    ALTER DATABASE YourDatabaseName SET RESTRICTED_USER WITH ROLLBACK IMMEDIATE;
  • If the transaction log itself is deferred, avoid restarting the SQL Server service repeatedly, as this can trigger the same deferred transaction failure on every startup.
  • Back up the current (corrupted) state of the database and log files, even if non-functional, before proceeding with repair in case rollback steps make things worse.

Step 3: Restore from a Clean Backup

  • Locate your most recent valid full backup and subsequent transaction log backups (stored typically in D:\SQLBackups\ or your configured backup directory).
  • Perform a page-level restore if only specific pages are corrupted:
    RESTORE DATABASE YourDatabaseName PAGE='1:12345' FROM DISK = 'D:\SQLBackups\FullBackup.bak' WITH NORECOVERY;
  • Follow with transaction log restores to bring the page back in sync:
    RESTORE LOG YourDatabaseName FROM DISK = 'D:\SQLBackups\LogBackup.trn' WITH RECOVERY;

Step 4: Run Repair as a Last Resort

  • If no valid backup exists, run DBCC CHECKDB ('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) only after placing the database in single-user mode.
  • Understand this step may delete corrupted rows or pages entirely, resulting in permanent data loss for those records.
  • Re-run DBCC CHECKDB afterward to confirm no further errors are reported.

Step 5: Investigate and Resolve Underlying Hardware Issues

  • Check Windows Event Viewer (Event Viewer > Windows Logs > System) for Disk, NTFS, or Virtual Disk Service (VDS) warnings around the time of the incident.
  • Run chkdsk D: /F /R on the volume hosting your SQL data files to detect and repair file system-level issues.
  • Verify SAN/RAID controller health and firmware is current, as faulty storage is the most common root cause of recurring page corruption.

Alternative or Verification Steps

  • After recovery, re-run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to confirm zero allocation or consistency errors remain.
  • If corruption recurs shortly after resolution, enable Page Verification: CHECKSUM (ALTER DATABASE YourDatabaseName SET PAGE_VERIFY CHECKSUM;) and schedule more frequent integrity checks to catch hardware-level issues earlier.

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

Troubleshooting Guide: SQL Server Error 3316

Why This Error Happens

Error 3316 occurs when SQL Server encounters an unrecoverable error while attempting to undo (roll back) a logged operation during the recovery or rollback phase of a transaction. This is typically caused by physical corruption in the database files (MDF/LDF), a corrupted transaction log, or an inconsistency between the data pages and the log records that describe changes to them. In some cases, it can also result from storage subsystem failures, improper shutdowns, or disk-level issues that occurred while SQL Server was writing to disk on Windows Server 2025 or Windows 11.

Step-by-Step Resolution Guide

Step 1: Verify the Scope of Corruption

  • Open SQL Server Management Studio (SSMS) and check the SQL Server Error Log for the full text of Error 3316, noting the database name and any accompanying errors (e.g., 823, 824, or 825).
  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to identify the extent of corruption in data and log files.
  • Check Windows Event Viewer (Application and System logs) for underlying disk or storage controller errors that may have triggered the corruption.

Step 2: Take the Database Offline and Attempt Emergency Mode Repair

  • Place the database in EMERGENCY mode to allow read-only access and further diagnostics:
  ALTER DATABASE YourDatabaseName SET EMERGENCY;
  • Set the database to SINGLE_USER mode before attempting repair:
  ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • Run DBCC CHECKDB('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS, ALL_ERRORMSGS; as a last resort, understanding this may discard corrupted transactions.

Step 3: Restore from a Known Good Backup

  • If repair fails or data loss is unacceptable, restore the database from the last verified full backup plus subsequent transaction log backups:
  RESTORE DATABASE YourDatabaseName FROM DISK = 'C:\Backups\YourDatabaseName_Full.bak' WITH NORECOVERY;
  RESTORE LOG YourDatabaseName FROM DISK = 'C:\Backups\YourDatabaseName_Log1.trn' WITH RECOVERY;
  • Ensure the backup files are stored on a healthy, non-corrupted volume (preferably separate from the original data drive).

Step 4: Check and Remediate Underlying Storage Health

  • Run chkdsk C: /f /r (replace with the correct drive letter) on the Windows Server 2025 or Windows 11 host to scan for and repair file system-level disk errors.
  • Review RAID controller logs or Storage Spaces health status (Get-VirtualDisk in PowerShell) if using virtualized or pooled storage.
  • Update storage drivers and firmware to the latest vendor-recommended versions to prevent recurrence.

Step 5: Restore Database to Multi-User Mode

  • Once the database is verified stable, return it to normal operation:
  ALTER DATABASE YourDatabaseName SET MULTI_USER;
  • Monitor the SQL Server Error Log for 24–48 hours to confirm Error 3316 does not reoccur.

Alternative or Verification Steps

  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; again post-resolution to confirm zero allocation and consistency errors.
  • If corruption persists after repair and restore attempts, engage Microsoft Customer Support Services (CSS) for advanced page-level recovery, and consider migrating the database to new storage hardware entirely.

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

Troubleshooting Guide: SQL Server Error 3314

Why This Error Happens

Error 3314 occurs when SQL Server encounters an inconsistency while rolling back (undoing) a logged transaction, typically because the transaction log or the associated database page is corrupted or in an unexpected state. This often stems from unexpected system shutdowns, storage subsystem failures (disk corruption, faulty I/O), or hardware-level write failures that left the database in a torn or inconsistent state. In rare cases, it can also result from a SQL Server engine bug interacting with third-party VSS-based backup tools during snapshot operations.

Step-by-Step Resolution Guide

Step 1: Identify the Scope of Corruption

  • Check the SQL Server Error Log (via SQL Server Management Studio or C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the full text of Error 3314, noting the database name and Page ID (%S_PGID).
  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to assess the full extent of corruption.
  • Review Windows Event Viewer (Application and System logs) on Windows Server 2025/Windows 11 for correlating disk or storage controller errors (Event ID 7, 9, 51).

Step 2: Restore from a Known Good Backup

  • If corruption is confirmed, the safest fix is restoring the database from the last verified clean backup taken before the error occurred.
  • Use RESTORE DATABASE YourDatabaseName FROM DISK = 'D:\Backups\YourDatabase.bak' WITH NORECOVERY; followed by applying transaction log backups if using the Full Recovery Model.
  • Avoid restarting the SQL Server service repeatedly on the damaged database, as repeated rollback attempts can worsen corruption on the same page.

Step 3: Run Emergency Repair (If No Backup Exists)

  • As a last resort, set the database to EMERGENCY mode: ALTER DATABASE YourDatabaseName SET EMERGENCY;
  • Set it to single-user mode: ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • Run DBCC CHECKDB('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS; — note this may delete corrupted rows/pages to restore consistency, so only use this when data loss is acceptable.
  • Return the database to multi-user mode: ALTER DATABASE YourDatabaseName SET MULTI_USER;

Step 4: Validate Underlying Storage Hardware

  • Run chkdsk D: /f /r (replace D: with your data drive) on Windows Server 2025 to scan for and repair physical disk errors.
  • Check storage driver versions and firmware for SAN/NAS devices or RAID controllers, updating them via Windows Update or the vendor’s management console if outdated.
  • If using virtualized storage (Hyper-V/VMware), verify the virtual disk isn’t experiencing latency spikes or I/O timeouts under heavy load.

Alternative or Verification Steps

  • After repair or restore, run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; again and confirm it returns zero allocation and consistency errors.
  • If Error 3314 recurs on the same page after restoration, treat it as a hardware fault — move the database files to a different physical disk/LUN and re-run the backup/restore cycle to confirm stability.

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

Troubleshooting Guide: SQL Server Error 3315 During Rollback

Why This Error Happens

Error 3315 occurs when SQL Server encounters a corrupted or unreadable log record while attempting to roll back a transaction, often because the transaction log file has been damaged by unexpected shutdowns, storage failures, or disk corruption. This can also happen if the log sequence number (LSN) chain is broken due to improper backup/restore operations or hardware-level I/O errors that silently corrupted log blocks. Since rollback depends entirely on reading consistent log records to undo operations, any corruption in that chain makes it impossible for SQL Server to complete the undo phase, potentially leaving the database in a suspect or recovery-pending state.

Step-by-Step Resolution Guide

Step 1: Verify the Database State and Capture Diagnostic Information

  • Run SELECT name, state_desc FROM sys.databases WHERE name = 'YourDB'; to confirm if the database is in SUSPECT, RECOVERY_PENDING, or RESTORING state.
  • Check the SQL Server Error Log (default path: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the full 3315 message, including the page ID and file ID referenced.
  • Run DBCC CHECKDB('YourDB') WITH NO_INFOMSGS, ALL_ERRORMSGS; to assess the scope of corruption (note: this may fail if the DB is not in a readable state yet).

Step 2: Attempt Emergency Mode Repair

  • Set the database to EMERGENCY mode using: ALTER DATABASE YourDB SET EMERGENCY;
  • Place the database in single-user mode: ALTER DATABASE YourDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • Run DBCC CHECKDB('YourDB', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS; — be aware this step can discard the corrupted transaction, so only proceed if no clean backup is available.
  • Revert to multi-user mode afterward: ALTER DATABASE YourDB SET MULTI_USER;

Step 3: Restore From a Verified Backup (Preferred Over Repair)

  • Locate your most recent full backup and subsequent log backups, typically stored under D:\SQLBackups\ or your configured backup share.
  • Restore the full backup with NORECOVERY, then apply transaction log backups up to the point just before the corruption occurred: RESTORE DATABASE YourDB FROM DISK = 'D:\SQLBackups\YourDB_Full.bak' WITH NORECOVERY;
  • Finish with RESTORE DATABASE YourDB WITH RECOVERY; to bring the database back online cleanly without the corrupted rollback transaction.

Step 4: Check Underlying Storage Health

  • Open Windows Event Viewer (eventvwr.msc) and review the System log for Disk, NTFS, or Storport errors that coincide with the time of the 3315 error.
  • Run chkdsk D: /f /r (replace with your SQL data/log drive) during a maintenance window to detect and repair physical disk issues.
  • If running on virtualized or SAN storage, validate the underlying storage controller and multipathing drivers are up to date on Windows Server 2025.

Alternative or Verification Steps

  • After recovery, run DBCC CHECKDB('YourDB') WITH NO_INFOMSGS, ALL_ERRORMSGS; again to confirm zero allocation and consistency errors before resuming production traffic.
  • If corruption recurs, configure CHECKSUM page verification (ALTER DATABASE YourDB SET PAGE_VERIFY CHECKSUM;) and schedule regular DBCC CHECKDB jobs to catch storage-level corruption early.

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

Troubleshooting Guide: SQL Server Error 3313

Why This Error Happens

Error 3313 occurs when SQL Server encounters an inconsistency while redoing a logged operation during crash recovery, typically indicating that a transaction log record cannot be applied to the corresponding data page. This is most commonly caused by underlying storage corruption, an abrupt power loss or I/O failure that left the database in an inconsistent state, or a mismatch between the transaction log (.ldf) and data file (.mdf/.ndf) due to improper backup/restore sequencing. In some cases, faulty storage drivers or disk subsystem errors on Windows Server 2025 can silently corrupt pages before SQL Server attempts to redo them during recovery.

Step-by-Step Resolution Guide

Step 1: Check the SQL Server Error Log and Windows Event Viewer

  • Open SQL Server Management Studio (SSMS) and review the error log located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Cross-reference with Windows Event Viewer under Windows Logs > System and Application for disk (Event ID 7, 9, 11) or storage controller errors occurring around the same timestamp.
  • Note the exact database name and page ID (%S_PGID) referenced in the error for targeted repair.

Step 2: Run DBCC CHECKDB to Assess Corruption Scope

  • Take the database offline or ensure no active transactions are running, then execute:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review output for allocation or consistency errors tied to the reported page ID.
  • If corruption is confirmed, note whether it is isolated to a single page or widespread across the database.

Step 3: Restore from a Clean Backup

  • Identify the most recent verified full backup along with subsequent differential and transaction log backups.
  • Restore the database using:
  RESTORE DATABASE [YourDatabaseName] 
  FROM DISK = 'D:\Backups\YourDatabaseName_Full.bak' 
  WITH NORECOVERY;
  RESTORE LOG [YourDatabaseName] 
  FROM DISK = 'D:\Backups\YourDatabaseName_Log.trn' 
  WITH RECOVERY;
  • Ensure the backup chain is unbroken to avoid re-triggering the same redo failure.

Step 4: Repair Isolated Page Corruption (If No Clean Backup Exists)

  • If only a single page is affected and a full restore isn’t feasible, attempt:
  DBCC CHECKDB ('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS);
  • Run this only as a last resort, since it may discard corrupted rows permanently.
  • Back up the database immediately afterward to prevent recurrence from the same root storage issue.

Step 5: Validate Underlying Storage Hardware

  • On Windows Server 2025, run chkdsk D: /f /r against the volume hosting the SQL data/log files.
  • Update storage controller and disk drivers via Device Manager or the OEM’s management utility (e.g., RAID controller firmware).
  • Confirm that disk write-caching policies align with SQL Server’s requirements (write-through caching recommended for log volumes).

Alternative or Verification Steps

  • After recovery, run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; again to confirm zero allocation or consistency errors remain.
  • If the error persists despite a clean restore, engage Microsoft Support with the SQL Server memory dump and error log, as it may indicate a hardware-level fault or a SQL Server Engine bug requiring a Cumulative Update (CU) patch.

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

Troubleshooting Guide: Error 3303 — Remote Harden of Transaction Failed

Why This Error Happens

Error 3303 occurs when a transaction being hardened (written to the transaction log) on a remote secondary replica fails to complete within the expected time or encounters a write failure. This is typically caused by connectivity interruptions between Availability Group replicas, insufficient disk space or I/O bottlenecks on the secondary’s log drive, or corruption in the transaction log file itself. It can also surface when the secondary replica’s log drive has stale permissions preventing SQL Server’s service account from writing to the log path.

Step-by-Step Resolution Guide

Step 1: Verify Network Connectivity Between Replicas

  • Check the Always On Availability Group dashboard in SSMS for the affected database to confirm synchronization health.
  • Run Test-NetConnection -ComputerName <SecondaryReplicaName> -Port 5022 (or your configured endpoint port) from the primary replica in PowerShell.
  • Review Windows Server 2025 firewall rules under Windows Defender Firewall with Advanced Security to ensure the AG endpoint port is open inbound/outbound on both nodes.

Step 2: Inspect Disk Space and I/O Performance on the Secondary

  • Navigate to the log file directory (commonly D:\SQLData\Logs\ or your custom path) and confirm free disk space is above 15-20%.
  • Open Performance Monitor and add counters for Avg. Disk sec/Write and Avg. Disk Queue Length on the volume hosting the .ldf file.
  • If I/O latency exceeds 20ms consistently, consider moving the log file to a faster storage tier or SSD-backed volume.

Step 3: Check SQL Server Service Account Permissions

  • Open Services.msc, locate the SQL Server service, and confirm the account running it has Full Control on the log directory.
  • Use icacls "D:\SQLData\Logs\" /grant "NT SERVICE\MSSQLSERVER":(OI)(CI)F to reset permissions if needed.
  • Restart the SQL Server service after applying permission changes.

Step 4: Validate Transaction Log Integrity

  • Run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to detect log or page-level corruption.
  • If corruption is found, restore the affected database from the last known good backup on the secondary replica.
  • Re-join the replica to the Availability Group using ALTER AVAILABILITY GROUP [AGName] JOIN; on the secondary instance.

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

  • Open Event Viewer > Windows Logs > Application and filter for Event ID 3303 to correlate the exact timestamp with other AG-related errors (e.g., Event ID 35201, 41414).
  • Cross-reference the SQL Server Error Log (ERRORLOG file in MSSQL\Log directory) for additional context around the failed LSN.

Alternative or Verification Steps

  • After applying fixes, manually force a log flush by running a small transaction on the primary and confirm it hardens successfully on the secondary via the AG dashboard (status should show “Synchronized”).
  • If the issue persists, consider temporarily removing the problematic secondary from the Availability Group, running a fresh full backup/restore, and re-adding it to rule out underlying log corruption.

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

Troubleshooting Guide: SQL Server Error 3302 – Redo Operation Failure During Recovery

Why This Error Happens

Error 3302 occurs when SQL Server’s recovery process cannot successfully redo logged transactions up to the expected Log Sequence Number (LSN), typically because the transaction log file has become physically corrupted or truncated unexpectedly. This often results from underlying storage failures, abrupt power loss during a write operation, antivirus software locking or modifying the .ldf file, or a faulty disk subsystem that failed to flush pages correctly. In virtualized or cloud environments, this can also stem from storage snapshot inconsistencies taken while the database was online.

Step-by-Step Resolution Guide

Step 1: Isolate the Database and Check Storage Health

  • Immediately take the database offline or set it to EMERGENCY mode to prevent further writes: ALTER DATABASE [YourDB] SET EMERGENCY;
  • Check the Windows Event Viewer (System and Application logs) for Disk, NTFS, or Volume Shadow Copy (VSS) errors around the timestamp of the failure.
  • Run chkdsk C: /f /r (replace with the correct drive letter hosting your .mdf/.ldf files) to rule out underlying disk corruption.

Step 2: Attempt Emergency-Mode Repair

  • Set the database to single-user mode to perform consistency checks: ALTER DATABASE [YourDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • Run DBCC CHECKDB (YourDB, REPAIR_ALLOW_DATA_LOSS) to attempt to rebuild the log and fix internal corruption.
  • Note: This step may result in data loss for transactions that were in-flight at the time of the corruption.

Step 3: Restore from a Verified Full Backup

  • Since Error 3302 explicitly indicates the log cannot be trusted for redo operations, locate your most recent verified full backup file (e.g., D:\SQLBackups\YourDB_Full.bak).
  • Use SQL Server Management Studio (SSMS) 21 or T-SQL to restore the backup: RESTORE DATABASE [YourDB] FROM DISK = 'D:\SQLBackups\YourDB_Full.bak' WITH REPLACE;
  • If available, apply subsequent differential and transaction log backups sequentially using WITH NORECOVERY until the final log backup, which should use WITH RECOVERY.

Step 4: Harden the Environment Against Future Corruption

  • Exclude the SQL Server data directories (default: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA) from any active antivirus or Windows Defender real-time scanning policies.
  • Verify that the storage controller’s write-caching policy is configured correctly (ensure “write-back” cache has battery backup/UPS protection) to prevent unflushed writes during power events.

Alternative or Verification Steps

  • Verify the Fix: After restoration, run DBCC CHECKDB (YourDB) WITH NO_INFOMSGS, ALL_ERRORMSGS; to confirm zero allocation or consistency errors exist before bringing the database back online for users.
  • Alternative Solution: If no full backup exists and REPAIR_ALLOW_DATA_LOSS fails, utilize a third-party log reader or the “Stellar/ApexSQL” recovery toolset to manually extract transaction data from the corrupted .ldf file before rebuilding the database schema from scratch.

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

Troubleshooting Guide: SQL Server Error 3301 – Transaction Log Corruption

Why This Error Happens

Error 3301 occurs when the SQL Server Storage Engine encounters an invalid or unrecognized log operation (logop) record while reading the transaction log, indicating the log stream has been physically or logically corrupted. This typically results from underlying disk I/O failures, faulty storage controllers, improper shutdowns during active write operations, or file system corruption on Windows Server 2025/Windows 11. It can also occur if third-party antivirus or backup software locks or modifies the LDF file while SQL Server has it open, leading to torn writes.

Step-by-Step Resolution Guide

Step 1: Verify the Scope of Corruption

  • Check the SQL Server Error Log (via SSMS or C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the specific LSN (Log Sequence Number) associated with Error 3301.
  • Run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORS; to determine if the corruption extends beyond the log file to the data pages.
  • Note the exact time of the last successful transaction to help pinpoint the required recovery point.

Step 2: Attempt Emergency Mode Repair (If No Backup is Viable)

  • If a valid backup chain is unavailable, set the database to Emergency Mode to bypass the corrupted log:
    ALTER DATABASE YourDatabaseName SET EMERGENCY;
  • Set the database to single-user mode to prevent new connections during the repair:
    ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • Run the repair command, acknowledging that this will rebuild the log and may result in data loss:
    DBCC CHECKDB ('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS);

Step 3: Restore from Full and Transaction Log Backups

  • Identify the last known good Full Backup (.bak) file in your backup directory (e.g., D:\SQLBackups\).
  • Restore the database using RESTORE DATABASE YourDatabaseName FROM DISK = 'D:\SQLBackups\LastGood.bak' WITH NORECOVERY;.
  • Apply subsequent transaction log backups sequentially using RESTORE LOG until you reach the point just before the corruption occurred, then run WITH RECOVERY on the final log file.

Step 4: Check Hardware and Storage Health

  • Open Event Viewer on Windows Server 2025 and navigate to Windows Logs > System to check for Disk or NTFS warnings (Event ID 7 or 51) that coincide with the SQL error.
  • Run chkdsk D: /f /r (replacing D: with your drive letter) during a maintenance window to scan for and repair physical disk errors on the volume hosting the LDF files.
  • If using a SAN or virtualized storage, verify the integrity of the underlying LUNs with your storage vendor’s diagnostic tools.

Alternative or Verification Steps

  • Verify the Fix: Once the database is back online, immediately run DBCC CHECKDB again to ensure the “ALLOCATION_ERROR” or corruption flags are cleared, and query the application’s audit tables to confirm data consistency for the recovery period.
  • Alternative Solution: If REPAIR_ALLOW_DATA_LOSS fails to bring the database online, detach the database, copy the .mdf file only (leaving the corrupted .ldf), and attempt to re-attach it using CREATE DATABASE ... FOR ATTACH_REBUILD_LOG to force SQL Server to generate a new transaction log.

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

Troubleshooting Guide: SQL Server Error 3299 (BackupToUrl Failure)

Why This Error Happens

Error 3299 occurs when SQL Server 2025’s BACKUP ... TO URL operation fails to properly communicate with Azure Blob Storage, typically due to an expired or malformed Shared Access Signature (SAS) token, an incorrect credential mapping, or a network timeout during the block transfer process. This can also surface when the backup file size exceeds the maximum block blob limits or when the storage account firewall rejects the originating IP address of the Windows Server 2025 host. In some cases, a corrupted or stale CREDENTIAL object in SQL Server retains outdated authentication details, causing the handshake with Azure Storage to fail mid-transfer.

Step-by-Step Resolution Guide

Step 1: Validate the SQL Server Credential Object

  • Run SELECT * FROM sys.credentials; in SSMS to confirm the credential tied to your storage container still exists.
  • Check that the IDENTITY value matches SHARED ACCESS SIGNATURE exactly (case-sensitive).
  • Drop and recreate the credential if the SAS token has expired: DROP CREDENTIAL [https://yourstorageaccount.blob.core.windows.net/yourcontainer];

Step 2: Regenerate and Re-Apply the SAS Token

  • Log into the Azure Portal and navigate to your Storage Account > Shared Access Signature.
  • Ensure permissions include Read, Write, Delete, List, and Create (rwdlc).
  • Set an extended expiration window (minimum 30 days) to avoid mid-backup failures.
  • Re-create the credential in SQL Server using the new token string, omitting the leading ? character.

Step 3: Check Network and Firewall Configuration

  • On Windows Server 2025, open PowerShell and test connectivity: Test-NetConnection yourstorageaccount.blob.core.windows.net -Port 443.
  • In the Azure Portal, confirm the Storage Account’s Networking settings allow the public IP of your SQL Server instance, or that “Allow trusted Microsoft services” is enabled if using a private endpoint.
  • Disable any local Windows Defender Firewall outbound rules blocking port 443 traffic.

Step 4: Adjust Backup Block Size and Compression Settings

  • Reduce the MAXTRANSFERSIZE parameter to 4194304 (4MB) in your backup command to avoid exceeding Azure Blob block limits.
  • Example: BACKUP DATABASE [YourDB] TO URL = 'https://yourstorageaccount.blob.core.windows.net/yourcontainer/yourdb.bak' WITH CREDENTIAL = 'yourstorageaccount', MAXTRANSFERSIZE = 4194304, COMPRESSION;
  • Confirm COMPRESSION is enabled to reduce transfer payload and avoid timeout-related corruption.

Step 5: Review SQL Server Error Logs for Underlying Detail

  • Open SQL Server Configuration Manager and locate the ERRORLOG via C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\.
  • Search for “3299” alongside any nested HRESULT or HTTP status codes (e.g., 403, 404) that indicate the precise Azure-side rejection reason.

Alternative or Verification Steps

  • Run a manual test backup of a small test database (WITH COPY_ONLY) to the same URL to confirm the credential and network path now succeed before resuming production backup jobs.
  • If the error persists, switch to using a Managed Identity-based credential instead of SAS tokens, which eliminates token expiration issues entirely on Windows Server 2025 when paired with Azure Arc-enabled SQL Server.

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

Troubleshooting Guide: SQL Server Error 3298 — Backup/Restore to URL Device Error

Why This Error Happens

Error 3298 occurs when SQL Server 2025 fails to communicate with the Azure Blob Storage (or other URL-based) device during a BACKUP or RESTORE operation. This is typically caused by an expired or malformed Shared Access Signature (SAS) token, an incorrectly configured SQL Credential tied to the storage account, or network-level blocking (firewall/proxy) preventing outbound HTTPS traffic to the blob endpoint. It can also result from a mismatch between the container access policy and the permissions granted to the credential.

Step-by-Step Resolution Guide

Step 1: Validate the SQL Credential and SAS Token

  • Open SQL Server Management Studio (SSMS) and run SELECT * FROM sys.credentials WHERE name LIKE '%url%'; to locate the credential used for the URL backup device.
  • Confirm the SAS token embedded in the credential’s secret has not expired by checking the se= (expiry) parameter in the token string.
  • If expired, regenerate a new SAS token from the Azure Portal under Storage Account > Shared Access Signature, ensuring Read, Write, List, Delete, Create permissions are checked.
  • Recreate the credential using:
  CREATE CREDENTIAL [https://yourstorageaccount.blob.core.windows.net/yourcontainer]
  WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
  SECRET = 'sv=2025-01-01&ss=b&srt=sco&sp=rwdlac...';

Step 2: Verify Network Connectivity to the Blob Endpoint

  • From the Windows Server 2025 / Windows 11 host, test connectivity using PowerShell:
  Test-NetConnection yourstorageaccount.blob.core.windows.net -Port 443
  • Ensure no corporate firewall, proxy, or NSG (Network Security Group) rule is blocking outbound traffic on port 443.
  • If using a proxy, confirm the SQL Server service account has the correct proxy settings configured in netsh winhttp show proxy.

Step 3: Check Storage Account Firewall and Container Policy

  • In the Azure Portal, navigate to Storage Account > Networking and confirm “Allow access from” includes the public IP of your Windows Server 2025 instance (or is set to “All networks” for testing).
  • Verify the target container exists and matches the exact path referenced in the TO URL clause of your backup command (case-sensitive).
  • Confirm the container’s access level isn’t set to “Private” in a way that conflicts with SAS-based access (SAS should override this, but double-check for conflicting Azure RBAC policies).

Step 4: Re-run the Backup/Restore Command with Verbose Logging

  • Execute the command with WITH STATS = 10 to capture progress and isolate where the failure occurs:
  BACKUP DATABASE [YourDB]
  TO URL = 'https://yourstorageaccount.blob.core.windows.net/yourcontainer/YourDB.bak'
  WITH CREDENTIAL = 'https://yourstorageaccount.blob.core.windows.net/yourcontainer', STATS = 10;
  • Review the SQL Server Error Log (Management > SQL Server Logs in SSMS) immediately after failure for the expanded %.*ls message detail, which usually contains the underlying HTTP status code (e.g., 403 Forbidden, 404 Not Found).

Alternative or Verification Steps

  • Verify the fix: Successfully run a small test backup (e.g., a system database like tempdb) to the same URL target; if it completes without Error 3298, the credential and connectivity are confirmed healthy.
  • Alternative workaround: If Azure Blob access remains unstable, temporarily switch to a local disk or SMB file share backup target (TO DISK = '\\fileserver\backups\') while investigating the storage account’s access policies further.

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

Troubleshooting Guide: SQL Server Error 3297 – Invalid URL Format

Why This Error Happens

Error 3297 occurs when SQL Server’s BACKUP or RESTORE command receives a URL (typically pointing to Azure Blob Storage) that does not conform to valid URI syntax. This is commonly caused by malformed container paths, missing or incorrect SAS token configurations, or a Credential object in SQL Server that references an outdated or improperly formatted endpoint. It can also occur if the storage account name or container path contains illegal characters or inconsistent casing that breaks absolute/relative URI resolution.

Step-by-Step Resolution Guide

Step 1: Validate the URL Syntax

  • Confirm the URL follows the pattern: https://<storageaccountname>.blob.core.windows.net/<containername>/<filename>.bak
  • Check for trailing slashes, double slashes, or missing https:// prefixes.
  • Ensure there are no spaces or special characters (like #, %, or unescaped &) in the container or blob name.

Step 2: Verify the SQL Server Credential Object

  • Run the following query to inspect existing credentials:
  SELECT * FROM sys.credentials;
  • Ensure the CREDENTIAL name exactly matches the container URL (not just the storage account) if using a Shared Access Signature (SAS).
  • Recreate the credential if needed:
  CREATE CREDENTIAL [https://yourstorageaccount.blob.core.windows.net/yourcontainer]
  WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
  SECRET = 'your_sas_token_without_leading_question_mark';

Step 3: Check for Leading Characters in the SAS Token

  • Open the SAS token used in the SECRET field of the credential.
  • Remove any leading ? character, as SQL Server 2025 strictly parses the token and will reject it if present, indirectly triggering Error 3297 due to URI resolution failure.
  • Re-run the backup/restore command after updating the token.

Step 4: Confirm Windows Server DNS Resolution

  • On Windows Server 2025, open Command Prompt and run:
  nslookup yourstorageaccount.blob.core.windows.net
  • If resolution fails, check the network adapter DNS settings in Control Panel > Network and Sharing Center > Change adapter settings.
  • Ensure outbound port 443 is open via Windows Defender Firewall with Advanced Security.

Alternative or Verification Steps

  • Test the fix by running a simple RESTORE FILELISTONLY FROM URL = '<your_url>' command; if it returns file metadata without error, the URL and credential are correctly configured.
  • If the issue persists, try using a local UNC path for the backup/restore operation to isolate whether the problem is specific to the Azure URL/credential configuration rather than SQL Server itself.

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

Troubleshooting Guide: Error 3296 — “The file %.*ls exists on the remote endpoint”

Why This Error Happens

Error 3296 occurs during SQL Server backup or restore operations when the backup process detects that a file with the identical name already exists at the remote endpoint (such as a network share, Azure Blob Storage container, or mirrored server location). This typically happens because SQL Server, by default, refuses to overwrite existing backup files unless explicitly instructed to do so via the INIT or FORMAT options. It can also surface due to stale file remnants from a previously failed or interrupted backup job that never cleaned up properly, or because of a naming collision in automated backup scripts that don’t generate unique timestamps.

Step-by-Step Resolution Guide

Step 1: Identify the Conflicting File on the Remote Endpoint

  • Check the exact file path referenced in the error message (replace %.*ls with the actual file name from your SQL Server Error Log).
  • For network shares, navigate to the UNC path (e.g., \\BackupServer\SQLBackups\) and confirm the file exists.
  • For Azure Blob Storage, use Azure Storage Explorer or az storage blob list to confirm the blob name collision.

Step 2: Modify the Backup Command to Allow Overwrite

  • Update your T-SQL backup statement to include the WITH INIT clause, which overwrites existing backup sets in the file:
  BACKUP DATABASE [YourDB] TO DISK = 'D:\Backups\YourDB.bak' WITH INIT;
  • If you need to fully reformat the media (ignoring existing headers), use WITH FORMAT instead:
  BACKUP DATABASE [YourDB] TO DISK = 'D:\Backups\YourDB.bak' WITH FORMAT;
  • If using Maintenance Plans, open the Back Up Database Task in SQL Server Management Studio (SSMS) and check “Overwrite the existing backup set.”

Step 3: Clean Up Stale Files from Failed Jobs

  • Open File Explorer or PowerShell and remove orphaned .bak or .trn files left behind by interrupted jobs:
  Remove-Item "\\BackupServer\SQLBackups\YourDB_old.bak" -Force
  • Review SQL Server Agent Job History (in SSMS under SQL Server Agent > Jobs) to identify which job step failed before cleanup completed.

Step 4: Implement Unique File Naming in Automation Scripts

  • Update backup scripts or SQL Agent job steps to append a dynamic timestamp to avoid future collisions:
  DECLARE @FileName NVARCHAR(500);
  SET @FileName = 'D:\Backups\YourDB_' + FORMAT(GETDATE(), 'yyyyMMdd_HHmmss') + '.bak';
  • If using PowerShell-based automation (e.g., dbatools), ensure the -FilePath parameter includes a timestamp variable rather than a static name.

Step 5: Verify Remote Endpoint Permissions

  • Confirm the SQL Server service account has Modify and Delete NTFS permissions on the target folder (Right-click folder > Properties > Security tab).
  • For Azure Storage endpoints, verify the SAS token or credential used has Write and Delete permissions assigned.

Alternative or Verification Steps

  • Re-run the backup job manually via SSMS or sqlcmd and confirm it completes without Error 3296 in the SQL Server Error Log (EXEC xp_readerrorlog).
  • If the error persists, test writing a dummy file directly to the remote endpoint using the SQL Server service account credentials to rule out an underlying permissions or connectivity issue rather than a naming conflict.

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

Troubleshooting Guide: Error 3295 — Backup To URL Exclusive Access Failure

Why This Error Happens

Error 3295 occurs when SQL Server 2025 cannot obtain exclusive access to the blob file at the destination URL because another process, session, or backup operation currently holds a lock on it. This is commonly caused by a previous backup job that did not terminate cleanly, a concurrent backup/restore operation targeting the same blob, or stale lease metadata left behind by Azure Blob Storage after an interrupted connection. In some cases, corrupted credential objects or expired Shared Access Signature (SAS) tokens can also cause SQL Server to retry against a file it believes is still locked.

Step-by-Step Resolution Guide

Step 1: Identify and Terminate Conflicting Sessions

  • Open SQL Server Management Studio (SSMS) and run sp_who2 or query sys.dm_exec_requests to check for any active backup/restore tasks referencing the same URL.
  • If a stale session is found, terminate it using KILL <session_id>.
  • Check Windows Server 2025 Task Scheduler and SQL Server Agent Jobs for overlapping backup schedules targeting the same blob container.

Step 2: Clear Blob Lease Locks in Azure Storage

  • Navigate to the Azure Portal and locate the Storage Account associated with your Backup to URL configuration.
  • Open the specific container and locate the .bak file in question.
  • Under Properties, check the Lease Status field; if it shows “Leased,” manually break the lease using Azure Storage Explorer or the following PowerShell command:
  • Get-AzStorageBlob -Container "yourcontainer" -Blob "yourfile.bak" -Context $ctx | ForEach-Object { $_.ICloudBlob.BreakLease() }

Step 3: Validate Credential and SAS Token Configuration

  • In SSMS, expand Server Objects > Credentials and verify the credential used for the backup matches the current Storage Account key or SAS token.
  • Regenerate the SAS token with sufficient read/write/delete permissions if it has expired.
  • Update the credential using:
  • ALTER CREDENTIAL [https://yourstorageaccount.blob.core.windows.net/yourcontainer] WITH IDENTITY = 'SHARED ACCESS SIGNATURE', SECRET = '<new_sas_token>';

Step 4: Restart SQL Server Service to Clear Internal File Handles

  • Open Services.msc on Windows Server 2025 and locate the SQL Server (MSSQLSERVER) service.
  • Restart the service to release any internal file handles SQL Server may still be holding against the URL target.
  • Re-run the backup job immediately after the service comes back online to prevent re-locking by other scheduled tasks.

Alternative or Verification Steps

  • Run the BACKUP DATABASE [YourDB] TO URL = '<blob_url>' WITH COPY_ONLY command manually in SSMS to confirm the exclusive lock issue is resolved without affecting your backup chain.
  • If the error persists, create a new blob container and point the backup destination there as a workaround, then investigate the original container’s lease history in Azure Monitor logs for root cause analysis.

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

Troubleshooting Guide: SQL Server Error 3293 – Backup/Restore to URL Initialization Failure

Why This Error Happens

Error 3293 typically occurs when SQL Server 2025 cannot establish a valid connection to the Azure Blob Storage URL specified in the BACKUP or RESTORE command. This is most commonly caused by an expired, malformed, or missing Shared Access Signature (SAS) credential, a misconfigured container URL, or outdated TLS protocols blocking the handshake between Windows Server 2025 and the Azure endpoint. In some cases, a corrupted or missing CREDENTIAL object within SQL Server itself prevents the engine from authenticating against the storage container during initialization.

Step-by-Step Resolution Guide

Step 1: Verify the SQL Server Credential Object

  • Open SSMS and run SELECT * FROM sys.credentials; to confirm the credential used for the URL backup exists.
  • Ensure the credential name exactly matches the container name in your backup URL (e.g., https://<account>.blob.core.windows.net/<container>).
  • If missing or outdated, drop and recreate it:
  CREATE CREDENTIAL [https://youraccount.blob.core.windows.net/yourcontainer]
  WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
  SECRET = 'your_new_sas_token';

Step 2: Regenerate and Validate the SAS Token

  • In the Azure Portal, navigate to your Storage Account > Shared access signature.
  • Confirm the token has not expired and includes Read, Write, List, Create permissions at minimum.
  • Copy the SAS token without the leading ? character, as SQL Server rejects tokens formatted incorrectly.
  • Update the credential in SQL Server using the ALTER CREDENTIAL syntax if the token was simply renewed.

Step 3: Check Network and TLS Configuration

  • On Windows Server 2025, open PowerShell as Administrator and verify TLS 1.2 (or higher) is enabled:
  Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client"
  • Confirm outbound port 443 is open to *.blob.core.windows.net via Windows Firewall or any corporate proxy/NSG rules.
  • Test connectivity directly using Test-NetConnection <account>.blob.core.windows.net -Port 443.

Step 4: Validate the Backup URL Syntax

  • Double-check the full URL string in your BACKUP DATABASE ... TO URL command for typos, incorrect container names, or trailing slashes.
  • Ensure the container referenced actually exists in the Azure Storage Account and is not soft-deleted.

Step 5: Restart SQL Server Services

  • After updating credentials or network settings, restart the SQL Server (MSSQLSERVER) service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER to clear cached connection states.

Alternative or Verification Steps

  • Run a test backup to a local disk path first to confirm the database itself isn’t corrupted, isolating the issue strictly to the URL connection.
  • If the error persists, use AzCopy or Azure Storage Explorer from the same Windows Server 2025 host to confirm the SAS token and network path work independently of SQL Server.

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

Troubleshooting Guide: SQL Server Error 3294 – URL Device Type Limited to a Single Device

Why This Error Happens

SQL Server 2025 enforces a restriction where BACKUP and RESTORE statements using the URL device type can only reference a single backup device per operation, unlike disk-based backups which support backup striping across multiple devices. Error 3294 is triggered when a T-SQL script explicitly lists multiple URL devices in the TO or FROM clause of a backup/restore command. This is a hardcoded engine limitation tied to how SQL Server manages Azure Blob Storage/URL-based credentials and block blob allocation, not a configuration or permissions defect.

Step-by-Step Resolution Guide

Step 1: Review the Offending T-SQL Script

  • Open the backup or restore script in SQL Server Management Studio (SSMS) or Azure Data Studio.
  • Locate the BACKUP DATABASE ... TO URL = '...' or RESTORE DATABASE ... FROM URL = '...' statement.
  • Check whether multiple URL = 'https://...' entries are listed in a comma-separated fashion within the same command.

Step 2: Consolidate to a Single URL Device

  • Rewrite the script to reference only one URL device per backup/restore operation.
  • Example corrected syntax:
  BACKUP DATABASE [YourDatabase]
  TO URL = 'https://yourstorageaccount.blob.core.windows.net/backupcontainer/YourDatabase.bak'
  WITH CREDENTIAL = 'YourSQLCredential', COMPRESSION, STATS = 10;
  • If you require splitting large backups, instead use a single URL target with MAXTRANSFERSIZE and BLOCKSIZE options to optimize throughput rather than multiple device entries.

Step 3: Validate the SQL Credential and Container Path

  • Confirm the CREDENTIAL object mapped to the storage container is valid and not pointing to multiple inconsistent endpoints.
  • Run: SELECT * FROM sys.credentials; to verify only one credential maps per container/storage account.
  • Ensure the Shared Access Signature (SAS) token or Storage Account Key referenced in the credential has not expired.

Step 4: Re-run the Backup/Restore Job

  • Execute the corrected single-URL script manually in SSMS to confirm Error 3294 no longer appears.
  • If running via SQL Server Agent Job, update the job step’s command text with the corrected single-device syntax and save the job.

Alternative or Verification Steps

  • Verify success by checking msdb.dbo.backupset and backupmediafamily tables to confirm the backup registered a single media family with device_type = 7 (URL).
  • If multiple backup targets are a hard requirement, use separate scheduled jobs writing to different URL destinations sequentially, rather than attempting simultaneous multi-URL striping within one command.

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

Troubleshooting Guide: SQL Server Error 3292 (URL Backup/Restore Device Failure)

Why This Error Happens

Error 3292 occurs when SQL Server 2025 cannot establish a valid connection to the URL-based backup device, typically due to invalid or expired Shared Access Signature (SAS) credentials, a malformed container URL, or network-level blocking of HTTPS traffic to Azure Blob Storage. This can also surface when the SQL Server service account lacks a properly configured CREDENTIAL object mapping to the storage account, or when the underlying OS-level TLS/SSL stack on Windows Server 2025 rejects the certificate used by the storage endpoint. Since SQL Server relies on the Windows HTTP stack (WinHTTP) to negotiate these connections, any OS-level networking or certificate trust issue will manifest as this generic backup/restore failure.

Step-by-Step Resolution Guide

Step 1: Validate the SQL Server Credential and SAS Token

  • Run SELECT * FROM sys.credentials; to confirm the credential tied to your storage account URL still exists.
  • Check the SAS token expiration date in Azure Portal under Storage Account > Shared Access Signature.
  • If expired, regenerate a new SAS token and recreate the credential using:
  CREATE CREDENTIAL [https://youraccount.blob.core.windows.net/yourcontainer]
  WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
  SECRET = 'your_new_sas_token';

Step 2: Check Network and Firewall Connectivity

  • Verify outbound HTTPS (port 443) traffic is allowed from the Windows Server 2025 host to *.blob.core.windows.net.
  • Use Test-NetConnection youraccount.blob.core.windows.net -Port 443 in PowerShell to confirm connectivity.
  • Confirm no proxy or corporate firewall is intercepting/blocking SSL traffic to Azure endpoints.

Step 3: Review the Windows Event Log for Root Cause

  • Open Event Viewer > Windows Logs > Application and System to locate the detailed OS-level error referenced by SQL Server.
  • Look for WinHTTP, Schannel, or CAPI2 errors occurring at the same timestamp as the 3292 error.
  • Note any TLS handshake failures or certificate chain errors, as these point to expired/untrusted root certificates on the OS.

Step 4: Update TLS and Certificate Trust Store

  • Ensure Windows Server 2025 has the latest cumulative updates installed via Windows Update to maintain current root CA certificates.
  • Manually verify the Azure storage SSL certificate chain is trusted by running:
  certutil -verify -urlfetch yourcertificate.cer
  • Restart the SQL Server (MSSQLSERVER) service after applying any certificate or OS updates.

Step 5: Re-test the Backup/Restore Command

  • Execute a test backup to the URL device:
  BACKUP DATABASE [YourDB]
  TO URL = 'https://youraccount.blob.core.windows.net/yourcontainer/yourdb.bak'
  WITH CREDENTIAL = 'https://youraccount.blob.core.windows.net/yourcontainer';
  • Confirm the operation completes without triggering Error 3292.

Alternative or Verification Steps

  • Verify success by checking sys.dm_os_ring_buffers or SQL Server Error Log for any recurring 3292 entries after remediation.
  • If the issue persists, switch to a Managed Identity-based authentication method (instead of SAS) for the credential, as this bypasses manual token expiration issues entirely.

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

Troubleshooting Guide: SQL Server Error 3290 — Backup to URL Exception

Why This Error Happens

Error 3290 occurs when SQL Server 2025 attempts to write a backup file directly to a URL endpoint (Azure Blob Storage or S3-compatible storage) but receives an exception from the remote storage endpoint rather than a successful acknowledgment. This is typically caused by invalid or expired Shared Access Signature (SAS) credentials, incorrect container permissions, network/firewall restrictions blocking outbound HTTPS traffic to the storage endpoint, or the target container/bucket not existing. In some cases, the underlying storage account itself may be throttling requests or experiencing a transient outage, which SQL Server surfaces as a generic remote exception.

Step-by-Step Resolution Guide

Step 1: Validate the Credential or SAS Token

  • Open SQL Server Management Studio (SSMS) and run SELECT * FROM sys.credentials; to confirm the credential used for the backup still exists and matches the storage account name.
  • Check the SAS token expiration date — tokens issued via Azure Portal or az storage container generate-sas often expire silently.
  • Regenerate the credential using:
  CREATE CREDENTIAL [https://<account>.blob.core.windows.net/<container>]
  WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
  SECRET = '<new_sas_token>';

Step 2: Verify Container Existence and Permissions

  • Confirm the target container (e.g., sqlbackups) exists in the storage account; SQL Server will not auto-create containers.
  • In Azure Portal, check the SAS token permissions include Read, Write, List, Create, and Delete on the container/service scope.
  • If using S3-compatible storage, confirm the bucket policy allows PutObject and ListBucket for the IAM credentials in use.

Step 3: Check Network and Firewall Connectivity

  • From the Windows Server 2025 / Windows 11 host, test outbound connectivity:
  Test-NetConnection <account>.blob.core.windows.net -Port 443
  • Ensure no corporate proxy, NSG rule, or Windows Defender Firewall rule is blocking port 443 outbound.
  • If a proxy is required, confirm SQL Server service account has proxy settings configured via netsh winhttp show proxy and update if necessary.

Step 4: Review SQL Server Error Log for the Full Exception Text

  • Open SQL Server Error Log (via SSMS → Management → SQL Server Logs) and locate the full %.*ls expanded message tied to Error 3290.
  • The expanded text usually reveals the actual HTTP status code (e.g., 403 Forbidden, 404 Not Found) from the storage endpoint — use this to pinpoint whether it’s an auth, path, or throttling issue.

Step 5: Retry the Backup with Compression and Smaller Block Size

  • If the error correlates with large backup files timing out, retry using:
  BACKUP DATABASE [YourDB]
  TO URL = 'https://<account>.blob.core.windows.net/sqlbackups/yourdb.bak'
  WITH COMPRESSION, MAXTRANSFERSIZE = 4194304, BLOCKSIZE = 65536;
  • Smaller block/transfer sizes reduce the chance of intermittent remote endpoint timeouts.

Alternative or Verification Steps

  • Run a manual test backup to the same URL immediately after updating credentials — a successful completion with 100 percent processed confirms the fix.
  • As an alternative, test connectivity and permissions independently using AzCopy or Azure Storage Explorer with the same credentials to isolate whether the issue is SQL Server-specific or a genuine storage/network problem.

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

Troubleshooting Guide: SQL Server Error 3291 — “URL Device Type Was Specified”

Why This Error Happens

Error 3291 occurs when a BACKUP or RESTORE statement specifies a URL device type (used for backing up to Azure Blob Storage) but the syntax, credential, or endpoint configuration doesn’t meet the requirements SQL Server expects for that device type. This typically stems from a missing or misconfigured SQL Server CREDENTIAL object, an invalid or malformed URL path, or the absence of a corresponding SAS token/storage account key needed to authenticate against the Blob container. It can also occur if the backup command mixes incompatible device types (e.g., combining DISK and URL in the same statement) or if the storage endpoint is unreachable due to networking/firewall restrictions.

Step-by-Step Resolution Guide

Step 1: Validate the BACKUP/RESTORE Syntax

  • Ensure the command uses TO URL = 'https://<storageaccount>.blob.core.windows.net/<container>/<filename>.bak' with no trailing slashes or extra parameters.
  • Confirm you are not mixing DISK = and URL = in the same backup statement — SQL Server 2025 requires device type consistency.
  • Example correct syntax:
  BACKUP DATABASE [YourDB]
  TO URL = 'https://mystorageacct.blob.core.windows.net/sqlbackups/YourDB.bak'
  WITH CREDENTIAL = 'AzureBlobCredential', COMPRESSION;

Step 2: Recreate or Verify the SQL Server Credential

  • Open SSMS and run:
  SELECT * FROM sys.credentials WHERE name = 'AzureBlobCredential';
  • If missing or outdated, recreate it using a valid Shared Access Signature (SAS) token:
  CREATE CREDENTIAL [https://mystorageacct.blob.core.windows.net/sqlbackups]
  WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
  SECRET = '<SAS_TOKEN_WITHOUT_LEADING_QUESTION_MARK>';
  • Ensure the credential name exactly matches the container URL (case-sensitive) referenced in the backup command.

Step 3: Check Network and Firewall Access to Azure Storage

  • From Windows Server 2025, test connectivity using PowerShell:
  Test-NetConnection mystorageacct.blob.core.windows.net -Port 443
  • Confirm outbound HTTPS (port 443) is not blocked by Windows Defender Firewall or corporate proxy.
  • Verify the Azure Storage firewall allows the SQL Server’s public IP or virtual network under Storage Account > Networking.

Step 4: Update SQL Server and Verify Compatibility Level

  • Apply the latest Cumulative Update for SQL Server 2025 via SQL Server Setup or Microsoft Update Catalog.
  • Confirm database compatibility level supports URL backups:
  SELECT compatibility_level FROM sys.databases WHERE name = 'YourDB';
  • Restart the SQL Server service after updates using:
  Restart-Service -Name 'MSSQLSERVER' -Force

Alternative or Verification Steps

  • Run a test backup to a local DISK device first to confirm the database itself backs up correctly, isolating whether the issue is URL-specific.
  • If URL backups still fail, use Azure Storage Explorer to manually validate container permissions and confirm the SAS token hasn’t expired or been scoped incorrectly.

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

Troubleshooting Guide: SQL Server Error 3289 – “A Backup Device of Type URL Was Specified Without a Credential”

Why This Error Happens

This error occurs when SQL Server 2025 attempts to perform a BACKUP or RESTORE operation to/from Azure Blob Storage (URL device) without an associated SQL Server Credential object. SQL Server requires an explicit Credential mapped to the storage container URL to authenticate the request, since URL-based backups do not use Windows Authentication or integrated security. This typically happens when the credential was never created, was deleted, or does not match the exact container path referenced in the BACKUP DATABASE ... TO URL command.

Step-by-Step Resolution Guide

Step 1: Verify the Storage Account and Access Key/SAS Token

  • Log in to the Azure Portal and navigate to your Storage Account.
  • Under Security + networking > Access keys, copy the Key or generate a new Shared Access Signature (SAS) token with Read/Write/List/Delete permissions.
  • Confirm the container name matches exactly what will be referenced in the backup URL (e.g., https://<account>.blob.core.windows.net/<container>).

Step 2: Create a SQL Server Credential

  • Open SQL Server Management Studio (SSMS) and connect to your SQL Server 2025 instance.
  • Run the following T-SQL script, replacing values as needed:
CREATE CREDENTIAL [https://<account>.blob.core.windows.net/<container>]
WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
SECRET = '<SAS_Token_Without_Leading_?>';
  • Note: The IDENTITY name must be exactly SHARED ACCESS SIGNATURE when using SAS tokens; for Storage Account Keys, use IDENTITY = '<storage_account_name>'.

Step 3: Match the Credential Name to the Backup URL Path

  • Ensure the Credential name (the URL path) is identical, character-for-character, to the path used in your backup command.
  • Run a test backup:
BACKUP DATABASE [YourDatabase]
TO URL = 'https://<account>.blob.core.windows.net/<container>/YourDatabase.bak'
WITH COMPRESSION, STATS = 10;
  • Check for typos in the container name, trailing slashes, or protocol mismatches (http vs https).

Step 4: Validate Permissions on the SQL Server Service Account

  • Confirm the SQL Server service account (running under Windows Server 2025) has outbound internet/firewall access to *.blob.core.windows.net on port 443.
  • If using a proxy or restrictive firewall, whitelist the Azure Storage endpoint.

Step 5: Refresh Expired Credentials

  • If the SAS token has expired, regenerate it in Azure and update the credential using ALTER CREDENTIAL instead of creating a duplicate:
ALTER CREDENTIAL [https://<account>.blob.core.windows.net/<container>]
WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
SECRET = '<New_SAS_Token>';

Alternative or Verification Steps

  • Run SELECT * FROM sys.credentials; in SSMS to confirm the credential exists and the name exactly matches your backup URL.
  • If the error persists, test connectivity independently using Azure Storage Explorer with the same SAS token/key to rule out network or permission issues outside of SQL Server.

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

Troubleshooting Guide: SQL Server Error 3288 – Credential Name Does Not Exist or Access Denied

Why This Error Happens

Error 3288 occurs when SQL Server 2025 attempts to use a database-scoped or server-level credential (often during BACKUP, RESTORE, CREATE EXTERNAL DATA SOURCE, or Polybase operations) that either does not exist in the target scope or the executing principal lacks the necessary permissions to reference it. This frequently happens because the credential was created in a different database than the one being used, or because the credential name is case-mismatched or misspelled in the T-SQL statement. It can also occur if the login executing the command lacks CONTROL or ALTER ANY CREDENTIAL permissions, or if the credential was dropped/recreated after a database restore, breaking the mapping.

Step-by-Step Resolution Guide

Step 1: Verify the Credential Exists in the Correct Scope

  • Run SELECT name, credential_id FROM sys.credentials; to check server-level credentials.
  • Run SELECT name FROM sys.database_credentials; on the specific database context if using database-scoped credentials.
  • Confirm the exact spelling and casing matches what is referenced in your BACKUP, RESTORE, or EXTERNAL DATA SOURCE statement.

Step 2: Check and Grant Required Permissions

  • Ensure the login/user has ALTER ANY CREDENTIAL permission at the server level:
  GRANT ALTER ANY CREDENTIAL TO [YourLoginName];
  • For database-scoped credentials, confirm the user has CONTROL permission on the database:
  GRANT CONTROL ON DATABASE::[YourDatabaseName] TO [YourUserName];
  • Verify Windows Server 2025 service account running SQL Server has access to any underlying secret store (Azure Key Vault, Windows Credential Manager) referenced by the credential.

Step 3: Recreate the Credential if Missing or Corrupted

  • Drop any stale reference: DROP CREDENTIAL [CredentialName];
  • Recreate it with correct identity and secret:
  CREATE CREDENTIAL [CredentialName]
  WITH IDENTITY = 'StorageAccountName',
  SECRET = 'AccessKeyOrSASToken';
  • If using a database-scoped credential, ensure you run this inside the correct database context (USE YourDatabase; first).

Step 4: Validate SQL Server Service Account Context

  • Open Services.msc on Windows Server 2025 and confirm the SQL Server service is running under the expected domain or managed service account.
  • Cross-check that this account has not changed since the credential was last created, as credential encryption is tied to the Database Master Key and service master key.
  • If the master key was regenerated, run OPEN MASTER KEY DECRYPTION BY PASSWORD = 'YourPassword'; before retrying the operation.

Alternative or Verification Steps

  • After applying the fix, re-run the original failing command (e.g., BACKUP DATABASE ... TO URL or CREATE EXTERNAL DATA SOURCE) and confirm no Error 3288 is raised in SQL Server Management Studio or the SQL Error Log.
  • If the issue persists, use sp_helpcredential or query sys.credentials joined with sys.server_principals to confirm the credential-to-login mapping is intact, then restart the SQL Server service to clear any cached permission tokens.

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

Troubleshooting Guide: SQL Server Error 3287

Why This Error Happens

Error 3287 occurs when SQL Server reads a file header or page from a backup device and finds that the internal file ID structure does not match what the engine expects, indicating the backup media or database file has been corrupted or truncated. This typically results from disk-level corruption, an incomplete or interrupted backup write operation, a damaged backup tape/device, or mismatched/misaligned block sizes between the backup device and SQL Server’s I/O subsystem. It can also surface when a backup file has been transferred between systems using a method (such as ASCII-mode FTP) that alters binary data.

Step-by-Step Resolution Guide

Step 1: Verify the Integrity of the Backup File or Device

  • Check the file size of the .bak or .trn file against the expected size from the source system; a mismatch indicates a truncated transfer.
  • Run CHECKSUM validation if the backup was created WITH CHECKSUM by executing: RESTORE VERIFYONLY FROM DISK = 'D:\Backups\YourFile.bak' WITH CHECKSUM;
  • Confirm the file wasn’t moved using an FTP client or network share with binary-mode transfer disabled.

Step 2: Inspect the Underlying Storage for Disk Errors

  • Open an elevated Command Prompt on Windows Server 2025 and run chkdsk D: /f /r on the volume hosting the backup device (schedule a restart if it’s the system/boot volume).
  • Check Windows Event Viewer under Windows Logs > System for Disk or NTFS warning entries (Event ID 7 or 51) corresponding to the timeframe the backup was written.
  • If using a SAN or NAS, validate the storage controller logs for I/O timeouts or write-cache failures.

Step 3: Re-Create the Backup from a Known-Good Source

  • If the corrupted file originated from a primary database that is still accessible, run a fresh backup: BACKUP DATABASE [YourDB] TO DISK = 'D:\Backups\YourDB_New.bak' WITH CHECKSUM, INIT;
  • Avoid writing backups directly to removable or network drives with unstable connections; stage locally first, then copy.
  • If multiple backup files exist in a media set, ensure all files (.bak1, .bak2, etc.) are present and none are missing from the BACKUP DEVICE definition.

Step 4: Rebuild the Backup Device Configuration (If Applicable)

  • Drop and recreate any logical backup devices in SQL Server Management Studio (SSMS) under Server Objects > Backup Devices.
  • Use T-SQL to drop a stale device reference: EXEC sp_dropdevice 'OldBackupDevice';
  • Re-add the device pointing to a verified, non-corrupted physical file path.

Alternative or Verification Steps

  • After re-creating the backup, immediately test restoration on a non-production instance using RESTORE DATABASE [TestDB] FROM DISK = 'D:\Backups\YourDB_New.bak' WITH MOVE, REPLACE; to confirm the file structure is valid.
  • If the error persists only on specific hardware, run SQLIOSim or DBCC CHECKDB against the source database to rule out underlying data file corruption rather than a backup-specific issue.

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

Troubleshooting Guide: SQL Server Error 3286 – Backup File Metadata Mismatch

Why This Error Happens

Error 3286 occurs when SQL Server detects that the metadata recorded for a specific file in the backup media header does not match the metadata of the actual file being read during the backup operation. This typically happens due to a corrupted backup device, an interrupted prior backup write operation, or a mismatch caused by manually editing/moving backup files outside of SQL Server’s control. It can also surface when backup media is shared or overwritten by multiple concurrent SQL Server instances or third-party backup tools that are not fully compliant with the Microsoft Tape Format (MTF) specification.

Step-by-Step Resolution Guide

Step 1: Verify the Integrity of the Backup Media

  • Run RESTORE VERIFYONLY FROM DISK = 'C:\Backups\YourFile.bak' in SQL Server Management Studio (SSMS) to check if the file header is readable.
  • Check the physical backup file on disk (Windows Server 2025 path, e.g., D:\SQLBackups\) for file size inconsistencies or zero-byte files.
  • If using a NAS or SAN, confirm there were no network interruptions during the write process by checking Windows Event Viewer under Windows Logs > System.

Step 2: Isolate and Remove Conflicting Backup Sets

  • If using a backup device with multiple files (striped backup set), ensure all files (e.g., File1.bak, File2.bak) belong to the exact same backup operation and were not mixed from different backup jobs.
  • Delete the specific corrupted backup set using Transact-SQL: sp_delete_backuphistory.
  • Re-initialize the backup device entirely rather than appending to an existing file by using the WITH FORMAT option in your BACKUP DATABASE command to rule out header corruption from previous appends.

Step 3: Check for Concurrent Access and Antivirus Interference

  • Navigate to Windows Security settings or your third-party antivirus console and add an exclusion for the SQL Server backup directory (e.g., C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\).
  • Ensure no other scheduled task, script, or secondary backup software (like Veeam or Windows Server Backup) is attempting to lock or copy the .bak file at the exact same time the native SQL backup job runs.
  • Restart the SQL Server VSS Writer service via services.msc to clear any stuck shadow copy metadata that might conflict with the backup file handles.

Step 4: Rebuild the Backup Using a Fresh Full Backup

  • If the metadata mismatch persists on a specific file, do not attempt to append future differential or log backups to it.
  • Execute a new, standalone Full Backup: BACKUP DATABASE [YourDB] TO DISK = 'D:\SQLBackups\YourDB_Full_New.bak' WITH INIT, STATS = 10;
  • Update your maintenance plan or backup script to point to this newly created baseline file to prevent inheriting the metadata corruption from the old chain.

Alternative or Verification Steps

  • Verification: After creating the new backup, immediately run RESTORE HEADERONLY FROM DISK = 'D:\SQLBackups\YourDB_Full_New.bak' to confirm SQL Server can successfully read the file metadata without throwing Error 3286.
  • Alternative: If the error persists across all new backups, test writing the backup to a different local drive (bypassing the network) to rule out an underlying NTFS file system corruption or a faulty storage controller driver on the Windows Server 2025 host.

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

Troubleshooting Guide: SQL Server Error 3284 – Filemark Not Aligned

Why This Error Happens

Error 3284 occurs when SQL Server attempts to read a backup set using a block size that differs from the one originally used to write the backup to tape or file. This mismatch typically happens when the backup media was created with a non-default BLOCKSIZE parameter, but the RESTORE command is executed without explicitly specifying that same value. It can also surface when backup files are corrupted, truncated, or when a third-party backup tool wrote the media using a custom block alignment that native SQL Server restore operations don’t automatically detect.

Step-by-Step Resolution Guide

Step 1: Identify the Original Backup Block Size

  • Check the error message text itself — SQL Server usually suggests a possible block size value (the %d in the error).
  • If you have access to the original backup script or job history, look for a BLOCKSIZE = X parameter in the BACKUP DATABASE statement.
  • For tape-based backups, common values are 65536 or 524288; for disk-based backups, check if a third-party agent (e.g., Veeam, NetBackup) was used, as these often set custom block sizes.

Step 2: Re-Issue the RESTORE Command with Explicit BLOCKSIZE

  • Open SQL Server Management Studio (SSMS) or a query window connected to your Windows Server 2025 instance.
  • Run the restore command with the suggested or identified block size, for example:
  RESTORE DATABASE [YourDatabase]
  FROM DISK = N'D:\Backups\YourDatabase.bak'
  WITH BLOCKSIZE = 65536, FILE = 1, NORECOVERY;
  • If restoring from tape, ensure the device path matches the physical or virtual tape drive letter (e.g., \\.\Tape0).

Step 3: Verify Backup File Integrity

  • Run RESTORE VERIFYONLY FROM DISK = N'D:\Backups\YourDatabase.bak' WITH BLOCKSIZE = 65536; to confirm the file isn’t corrupted.
  • If verification fails even with correct block size, the backup file itself may be truncated or damaged — check the source storage (SAN, NAS, or local disk) for I/O errors in Event Viewer > Windows Logs > System.

Step 4: Check for Media and Hardware Conflicts

  • If using physical tape devices on Windows Server 2025, confirm the tape drive firmware and Windows device drivers are up to date via Device Manager.
  • Rule out conflicts with antivirus or backup agent software that may lock or modify the backup file mid-write by temporarily disabling real-time scanning on the backup directory.

Step 5: Rebuild the Backup Set if Necessary

  • If the block size cannot be determined and restore attempts continue to fail, re-run a fresh full backup using a known, default block size:
  BACKUP DATABASE [YourDatabase]
  TO DISK = N'D:\Backups\YourDatabase_new.bak'
  WITH INIT, BLOCKSIZE = 65536;
  • Store this new backup and retest the restore process immediately to confirm the fix.

Alternative or Verification Steps

  • Verify the fix: After a successful restore, run DBCC CHECKDB on the restored database to confirm there is no internal corruption carried over from the backup set.
  • Alternative approach: If BLOCKSIZE adjustments don’t resolve the issue, try restoring via sqlcmd from the command line with the -b flag for better error visibility, or use a third-party backup verification tool to extract and validate the backup header information.

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

Microsoft SQL Server 2025 Troubleshooting Guide: Error 3285 – Filemark Alignment Issue

Why This Error Happens

This error occurs when SQL Server reads a backup filemark from a tape or virtual tape device that does not align with the expected block boundary, typically because the backup was written using a different block size or by a non-native backup tool. It can also happen when backups are moved across different device types (e.g., physical tape to virtual tape library) that use inconsistent block alignment settings. While the restore will still complete, SQL Server falls back to a slower, unbuffered I/O path to safely read the misaligned data.

Step-by-Step Resolution Guide

Step 1: Verify the Backup Device Block Size

  • Open SQL Server Management Studio (SSMS) and run RESTORE HEADERONLY FROM <BackupDevice> to inspect metadata.
  • Check the BackupDeviceType and confirm whether the backup originated from a tape, virtual tape library (VTL), or disk-based device.
  • Compare this against the block size used by your current restore device in Windows Server 2025 Device Manager (Tape Drives node).

Step 2: Explicitly Set the BLOCKSIZE Option During Restore

  • Modify your RESTORE DATABASE command to manually define block size using:
  RESTORE DATABASE [YourDB]
  FROM TAPE = '\\.\Tape0'
  WITH BLOCKSIZE = 65536, FILE = 1;
  • Common aligned values are 512, 2048, or 65536 bytes — match this to the original backup device’s block size.
  • Avoid relying on SQL Server’s auto-detection when migrating backups between differing hardware.

Step 3: Update Tape/VTL Driver and Firmware

  • Navigate to Device Manager > Tape Drives, right-click the device, and select Update Driver.
  • Check the vendor’s support site for a Windows Server 2025–certified driver, since legacy drivers may miscalculate filemark boundaries.
  • Restart the Removable Storage service via services.msc after updating.

Step 4: Re-run Backup Using Native SQL Server Alignment

  • If you control the original backup job, re-issue it using SQL Server native BACKUP DATABASE with explicit BLOCKSIZE and MAXTRANSFERSIZE parameters to ensure consistent alignment for future restores.
  • Example:
  BACKUP DATABASE [YourDB]
  TO TAPE = '\\.\Tape0'
  WITH BLOCKSIZE = 65536, MAXTRANSFERSIZE = 1048576;

Alternative or Verification Steps

  • After applying the BLOCKSIZE fix, re-run the restore and confirm Error 3285 no longer appears in the SQL Server Error Log (SQL Server Logs in SSMS Object Explorer).
  • If the error persists, restore the backup to a disk-based .bak file first using WITH BLOCKSIZE matching, then perform a secondary restore from disk to eliminate tape-specific alignment issues entirely.

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

Why This Error Happens

Error 3283 typically occurs during a RESTORE or BACKUP operation when SQL Server 2025 cannot properly initialize the target backup file due to file system permission restrictions, a locked or corrupted backup header, or insufficient disk space on the target volume. This is also commonly triggered when the SQL Server service account lacks write/modify access to the destination directory on Windows Server 2025, or when the file path references a mapped network drive that the service account cannot resolve. In some cases, antivirus or Windows Defender real-time scanning locks the .bak or .trn file mid-write, causing the initialization handshake to fail.

Step-by-Step Resolution Guide

Step 1: Verify File System Permissions

  • Right-click the target backup folder (e.g., D:\SQLBackups\) and open Properties > Security.
  • Ensure the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control permissions.
  • Apply changes and restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 2: Check Disk Space and File Corruption

  • Confirm the destination drive has sufficient free space using Get-PSDrive in PowerShell.
  • Run CHKDSK D: /F /R on Windows Server 2025 to rule out underlying disk corruption.
  • If the file already exists, delete or rename the corrupted .bak/.trn file and re-attempt the operation with a fresh filename.

Step 3: Exclude SQL Directories from Antivirus/Defender

  • Open Windows Security > Virus & threat protection > Manage settings > Exclusions.
  • Add exclusions for the SQL data directory (e.g., C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA) and the backup destination folder.
  • Retry the BACKUP DATABASE or RESTORE DATABASE command from SQL Server Management Studio (SSMS).

Step 4: Validate the Path and Drive Mapping

  • If using a UNC or mapped network path, switch to a full UNC path (e.g., \\ServerName\ShareName\Backup.bak) instead of a mapped drive letter, since SQL Server service accounts often cannot resolve user-mapped drives.
  • Confirm connectivity using Test-Path \\ServerName\ShareName in PowerShell.

Alternative or Verification Steps

  • Run RESTORE VERIFYONLY FROM DISK = 'D:\SQLBackups\YourFile.bak' in SSMS to confirm the file initializes and passes validation without errors.
  • If the issue persists, check the SQL Server Error Log (ERRORLOG file in the LOG folder) and Windows Event Viewer (Application log) for corresponding I/O or access-denied entries that pinpoint the exact failure cause.

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

Why This Error Happens

Error 3281 is generated by the SQL Server backup/restore engine when it interacts with a tape or virtual tape device during a backup or restore operation. This message indicates that SQL Server released the device and issued a rewind command, which typically occurs when a backup job is canceled, a device handle is lost, or the underlying tape/VTL hardware reports an unready or disconnected state. In most cases, this is tied to unstable physical tape hardware, a misconfigured backup device path, or a virtual tape library (VTL) driver that is not fully compliant with SQL Server 2025’s I/O requirements on Windows Server 2025.

Step-by-Step Resolution Guide

Step 1: Verify the Tape or Backup Device Connection

  • Open Device Manager on Windows Server 2025 and confirm the tape drive or VTL adapter shows no yellow warning icons.
  • Run mt.exe -f \\.\Tape0 status from an elevated Command Prompt to confirm the device responds correctly.
  • Reseat physical SCSI/SAS/FC cables if using a physical tape unit, or restart the VTL service if using a virtual device.

Step 2: Check SQL Server Backup Device Configuration

  • In SQL Server Management Studio (SSMS), navigate to Server Objects > Backup Devices and confirm the device path matches the actual tape drive name (e.g., \\.\Tape0).
  • Re-create the backup device using sp_addumpdevice 'tape', 'TapeBackup', '\\.\Tape0'; if the path is stale or mismatched.
  • Avoid running concurrent backup jobs pointing to the same tape device, as contention triggers forced releases and rewinds.

Step 3: Update Drivers and SQL Server Cumulative Updates

  • Download the latest tape/VTL driver certified for Windows Server 2025 from the hardware vendor’s support site.
  • Apply the latest Cumulative Update (CU) for SQL Server 2025 via SQL Server Setup > Maintenance > Edition Upgrade/Patch, since backup/tape I/O fixes are frequently included in CUs.
  • Reboot the server after driver installation to ensure the tape controller re-initializes cleanly.

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

  • Open the SQL Server Error Log (ERRORLOG file, typically in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\) and search for Error 3281 context lines immediately before and after the entry.
  • Cross-reference with Windows Event Viewer under Applications and Services Logs > System for hardware-level tape errors (Event ID 9 or 15) occurring at the same timestamp.

Alternative or Verification Steps

  • Run a manual test backup using BACKUP DATABASE [TestDB] TO TAPE = '\\.\Tape0' WITH INIT; and confirm it completes without the 3281 message reappearing in the log.
  • If the error persists, switch the backup destination from physical tape to a disk-based backup (BACKUP DATABASE ... TO DISK = 'D:\Backups\TestDB.bak') to isolate whether the issue is tape-hardware-specific or SQL Server configuration-specific.

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

Why This Error Happens

Error 3279 typically occurs when SQL Server 2025 attempts to validate or decrypt a password-protected resource—such as a database master key, a certificate-protected backup, or a linked server credential—and the stored password hash no longer matches the one being supplied. This mismatch is most commonly caused by a stale Windows credential cache, a recent Active Directory password rotation that hasn’t synced with the SQL Server service account, or a corrupted Service Master Key (SMK) that can no longer decrypt dependent objects. In some cases, Windows 11 or Windows Server 2025’s stricter NTLM/Kerberos enforcement policies also reject the authentication handshake before SQL Server even evaluates the password, triggering this access-denied state.

Step-by-Step Resolution Guide

Step 1: Verify the SQL Server Service Account Credentials

  • Open SQL Server Configuration Manager and navigate to SQL Server Services.
  • Right-click the SQL Server instance, select Properties, and confirm the Log On tab shows the correct domain/local account.
  • Re-enter the password manually (even if it looks correct) and click Apply to force Windows to refresh the cached credential token.
  • Restart the SQL Server service to apply the change.

Step 2: Rebuild or Repair the Service Master Key

  • Open a new query window in SSMS connected via a sysadmin account.
  • Run the following to check SMK health:
OPEN MASTER KEY DECRYPTION BY PASSWORD = 'YourStrongPassword';
  • If this fails, restore the SMK from a known good backup:
RESTORE SERVICE MASTER KEY FROM FILE = 'C:\Backups\SMK_Backup.key'
DECRYPTION BY PASSWORD = 'OldPassword';
  • Ensure the backup file path is accessible by the SQL Server service account (check NTFS permissions on C:\Backups).

Step 3: Check Windows Credential Manager and Group Policy

  • Open Control Panel > Credential Manager on the host machine and remove any stale entries referencing the SQL Server service account.
  • Verify that Group Policy (via gpedit.msc or domain GPO) under Security Options hasn’t recently enforced “Network security: LAN Manager authentication level” changes that block NTLMv1 fallback, which Windows Server 2025 defaults to restricting.
  • Run gpupdate /force and reboot the server to apply policy changes cleanly.

Step 4: Reset the Password on the Protected Object

  • If the error points to a specific certificate or backup password (not the service account), use ALTER MASTER KEY or ALTER CERTIFICATE to reset the password:
ALTER MASTER KEY REGENERATE WITH ENCRYPTION BY PASSWORD = 'NewStrongPassword123!';
  • Document the new password immediately in your organization’s secrets vault.

Alternative or Verification Steps

  • Confirm the fix by running RESTORE VERIFYONLY against the affected backup file or re-attempting the original login/decryption operation that triggered Error 3279.
  • If the issue persists, check the SQL Server Error Log (ERRORLOG in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\) for a more detailed stack trace, and cross-reference the Windows Security Event Log (Event ID 4625) for correlated authentication failures.

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

Troubleshooting Guide: SQL Server Error 3280 – “Backups on raw devices are not supported”

Why This Error Happens

This error occurs when SQL Server’s BACKUP or RESTORE command points to a target path that resolves to a raw disk partition instead of a formatted file system path with a valid file name. Raw devices (unformatted partitions referenced directly, such as \\.\PhysicalDriveX or a bare volume GUID path without a file name) were deprecated in older SQL Server versions and are fully unsupported in SQL Server 2025. This typically happens due to legacy backup scripts, incorrect UNC/volume path syntax, or maintenance plans that were migrated from very old SQL Server instances without updating the destination path format.

Step-by-Step Resolution Guide

Step 1: Identify the Backup Destination Path in the Failing Script

  • Open the SQL Agent Job, maintenance plan, or T-SQL script that triggered the error.
  • Look for the TO DISK = or TO URL = clause in the BACKUP DATABASE statement.
  • Check if the path resembles a raw device reference, e.g., BACKUP DATABASE [MyDB] TO DISK = '\\.\PhysicalDrive2' or a bare drive path like E:\ without a file name.

Step 2: Correct the Path to Use a Valid File System Location

  • Update the destination to a fully qualified file path that includes a drive letter (or mounted volume), folder structure, and file name with a .bak extension.
  • Example corrected syntax:
  BACKUP DATABASE [MyDB] 
  TO DISK = 'E:\SQLBackups\MyDB_Full.bak' 
  WITH INIT, COMPRESSION;
  • If using a mounted volume instead of a drive letter, ensure the mount point is NTFS/ReFS formatted and accessible, e.g., C:\MountPoints\SQLData\MyDB_Full.bak.

Step 3: Verify the Target Volume Is Properly Formatted and Mounted

  • Open Disk Management (diskmgmt.msc) on Windows Server 2025 / Windows 11.
  • Confirm the target disk shows a File System value (NTFS or ReFS) and is not listed as “Unallocated” or “Raw.”
  • If the volume shows as RAW, format it first:
  Format-Volume -DriveLetter E -FileSystem NTFS -Confirm:$false

Step 4: Validate SQL Server Service Account Permissions

  • Ensure the SQL Server service account has Write and Modify NTFS permissions on the target backup folder.
  • Right-click the folder → Properties → Security tab → confirm the SQL Server service account (e.g., NT SERVICE\MSSQLSERVER) is listed with appropriate access.
  • Apply changes and restart the SQL Server service if permissions were modified.

Step 5: Re-run the Backup Job

  • Execute the corrected BACKUP DATABASE statement manually in SQL Server Management Studio (SSMS) to confirm the fix before re-enabling the scheduled job.

Alternative or Verification Steps

  • Run RESTORE VERIFYONLY FROM DISK = 'E:\SQLBackups\MyDB_Full.bak' to confirm the backup file is valid and readable.
  • If the error persists, check for any third-party backup software or SAN snapshot tools that may be exposing raw device paths to SQL Server instead of standard file system paths.

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

Troubleshooting Guide: SQL Server Error 3278 – “Failed to encrypt string %ls”

Why This Error Happens

Error 3278 occurs when SQL Server’s encryption subsystem fails to encrypt a string value, typically during backup encryption, Always Encrypted operations, or certificate-based encryption tasks. The most common root causes are a corrupted or inaccessible encryption certificate/key, insufficient permissions on the certificate’s private key file, or a mismatch between the algorithm specified and what the certificate/key supports. This can also surface when the Master Key or Service Master Key is not properly decrypted due to Windows DPAPI issues following a server migration or OS upgrade to Windows Server 2025.

Step-by-Step Resolution Guide

Step 1: Verify the Certificate or Key Used for Encryption

  • Run SELECT * FROM sys.certificates; to confirm the certificate exists and is not expired.
  • Check sys.symmetric_keys or sys.asymmetric_keys if using key-based encryption instead of certificates.
  • Look for a null or outdated pvt_key_last_backup_date which may indicate key corruption.

Step 2: Check File System Permissions on Key Material

  • Navigate to the certificate export path (commonly C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\ or a custom backup folder).
  • Ensure the SQL Server service account has explicit Read and Write permissions on any .pvk or .cer files referenced.
  • Use icacls "C:\path\to\certificate.pvk" /grant "NT SERVICE\MSSQLSERVER":(R,W) to reset permissions if needed.

Step 3: Re-encrypt or Restore the Database Master Key

  • Open SSMS and run OPEN MASTER KEY DECRYPTION BY PASSWORD = 'YourStrongPassword';
  • If the key is missing or corrupted, restore it using RESTORE MASTER KEY FROM FILE = 'C:\Backup\MasterKey.key' DECRYPTION BY PASSWORD = 'OldPassword' ENCRYPTION BY PASSWORD = 'NewPassword';
  • Re-run the original encryption command (e.g., BACKUP CERTIFICATE, ENCRYPTBYCERT, or ALTER COLUMN ENCRYPTION KEY) that triggered Error 3278.

Step 4: Validate Algorithm Compatibility

  • Confirm the encryption algorithm (e.g., AES_256) matches what the target certificate or column encryption key supports.
  • For Always Encrypted columns, verify the Column Master Key settings in SSMS under Security > Always Encrypted Keys.
  • Update the T-SQL statement to use a supported algorithm if a mismatch is found.

Step 5: Restart SQL Server Service and Clear Cache

  • Restart the SQL Server (MSSQLSERVER) service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.
  • This clears any cached key handles that may have become invalid after a Windows Server 2025 update.

Alternative or Verification Steps

  • Verify the fix by re-executing the failed encryption operation (backup, column encryption, or ENCRYPTBYCERT call) and confirming no error 3278 is thrown in the SQL Server Error Log.
  • If the issue persists, drop and recreate the certificate/key pair entirely using CREATE CERTIFICATE with a fresh private key, then re-associate it with the affected database objects.

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

Troubleshooting Guide: Error 3277 — “WITH SNAPSHOT must be used with only one device”

Why This Error Happens

This error occurs when a BACKUP or RESTORE statement specifies the WITH SNAPSHOT option alongside multiple backup devices in the same command. SQL Server 2025 requires snapshot-based backups to map to exactly one device because the snapshot operation is tied to a single underlying volume or VSS writer instance. This typically results from a scripted backup job, maintenance plan, or third-party backup tool that was configured for striped/multi-device backups and later had WITH SNAPSHOT appended without updating the device list.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Script or Job

  • Locate the T-SQL command generating the error by checking SQL Server Agent job history or the SQL Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG).
  • Run EXEC sp_readerrorlog 0, 1, '3277'; to pull the exact statement context.
  • Confirm whether the backup is part of a maintenance plan by opening SQL Server Management Studio (SSMS) and navigating to Management > Maintenance Plans.

Step 2: Correct the BACKUP/RESTORE Syntax

  • Edit the script to ensure only one TO DISK = or TO URL = device is listed when WITH SNAPSHOT is present.
  • Example of an invalid command:
  BACKUP DATABASE [SalesDB]
  TO DISK = 'D:\Backups\Sales1.bak', DISK = 'D:\Backups\Sales2.bak'
  WITH SNAPSHOT;
  • Corrected version:
  BACKUP DATABASE [SalesDB]
  TO DISK = 'D:\Backups\Sales_Full.bak'
  WITH SNAPSHOT;
  • If multi-device striping is required for performance, remove the WITH SNAPSHOT clause entirely instead.

Step 3: Validate VSS Writer and Volume Configuration

  • Ensure the SQL Server VSS Writer service is running: open services.msc and confirm SQL Server VSS Writer status is “Running.”
  • Run vssadmin list writers in an elevated Command Prompt on Windows Server 2025 to confirm the SQL writer reports “No error.”
  • Verify that the single target device resides on a volume supported by the underlying SAN/storage snapshot provider (required for WITH SNAPSHOT backups).

Step 4: Update Backup Automation Tools

  • If using a third-party backup solution (e.g., SAN-integrated snapshot tools), check for a Windows Server 2025–compatible update, as older connector versions may incorrectly generate multi-device syntax.
  • Re-run the backup job manually from SSMS to confirm the corrected single-device syntax executes without Error 3277.

Alternative or Verification Steps

  • Re-execute the corrected BACKUP DATABASE statement and confirm successful completion in the SSMS Messages tab (look for “processed X pages” without errors).
  • If WITH SNAPSHOT is not strictly required, remove it and use a standard multi-device striped backup instead, then schedule native snapshot backups separately through your storage array’s VSS-integrated tool.

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

Troubleshooting Guide: Error 3276 – “WITH SNAPSHOT” Restore Mismatch in SQL Server 2025

Why This Error Happens

This error occurs when a RESTORE command explicitly specifies the WITH SNAPSHOT option, but the backup set referenced in the backup device was not originally created using a snapshot-based backup (such as those generated by VSS-integrated third-party tools or native snapshot backup APIs). SQL Server validates the backup header (BackupType metadata) during the restore operation, and if the flag indicating a snapshot backup is absent, the engine immediately rejects the restore request to prevent data inconsistency. This is frequently seen in Windows Server 2025 environments where Storage Spaces Direct or SAN-level snapshot tools are used inconsistently between backup and restore scripts.

Step-by-Step Resolution Guide

Step 1: Verify the Backup Set Metadata

  • Open SQL Server Management Studio (SSMS) or a query window connected to the instance.
  • Run RESTORE HEADERONLY FROM DISK = 'C:\Backups\YourFile.bak' to inspect the IsSnapshot column in the result set.
  • If IsSnapshot returns 0, this confirms the backup was taken as a standard full/differential backup, not a snapshot.

Step 2: Correct the Restore Command Syntax

  • Remove the WITH SNAPSHOT clause from your RESTORE DATABASE or RESTORE LOG T-SQL statement if the backup set is a standard backup.
  • Example corrected syntax:
  RESTORE DATABASE [YourDB] 
  FROM DISK = 'C:\Backups\YourFile.bak' 
  WITH RECOVERY;
  • Ensure no PowerShell deployment scripts or Ola Hallengren maintenance solution jobs are hardcoding the SNAPSHOT flag for non-snapshot backup types.

Step 3: Audit the Backup Creation Process

  • Navigate to your backup automation tool (e.g., Windows Server Backup, SQLSafe, or a VSS Writer-based tool) and check the job configuration.
  • Confirm if the backup provider is configured to use VSS Hardware Provider or VSS Software Provider; only backups taken through a compliant VSS snapshot provider generate a true “Snapshot Backup” type recognized by SQL Server.
  • If snapshot restores are required for near-instant recovery, re-run the backup job using a certified VSS-aware backup solution rather than a standard BACKUP DATABASE T-SQL command.

Step 4: Re-run the Restore Without Snapshot Dependency

  • If a snapshot restore is strictly needed but the file is incompatible, restore the standard backup to a new database name first.
  • Use WITH MOVE 'LogicalFileName' TO 'C:\SQLData\NewPath.mdf' to relocate files if necessary during a standard restore, bypassing the snapshot requirement entirely.

Alternative or Verification Steps

  • Verification: After removing the WITH SNAPSHOT clause, check the SQL Server Error Log (Management > SQL Server Logs in SSMS) to confirm the restore completed with the message “RESTORE DATABASE successfully processed” and no Error 3276 recurrence.
  • Alternative: If you specifically require snapshot-based instant recovery, use the sp_addumpdevice system procedure to re-register the backup device correctly, or switch your backup provider to one that explicitly supports Microsoft VDI (Virtual Device Interface) snapshot technology.

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

Troubleshooting Guide: Error 3273 – Master Database Ambiguity in SQL Server 2025

Why This Error Happens

This error occurs when SQL Server 2025 detects a naming conflict between the system master database and a database involved in a Fabric Mirroring or Always On replication topology that is also internally referenced as a “replicated master” or PHYSMASTER. This typically happens during disaster recovery operations, database restores, or failover events where SQL Server cannot determine whether an action (such as a RESTORE, ALTER DATABASE, or recovery operation) should target the physical system master database or the logical replicated master reference. The ambiguity is a safeguard introduced in SQL Server 2025 to prevent accidental corruption of system-level metadata during complex replication or mirroring scenarios.

Step-by-Step Resolution Guide

Step 1: Identify the Conflicting Action

  • Open the SQL Server Error Log via SQL Server Management Studio (SSMS) or navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Locate the exact action referenced in the %ls placeholder of the error message (e.g., RESTORE DATABASE, ALTER DATABASE SET, or DBCC CHECKDB).
  • Note the session ID and timestamp to correlate with any active Always On Availability Group or Fabric Mirroring session.

Step 2: Explicitly Specify the Target Database Context

  • Re-run the failed command but explicitly qualify it with either PHYSMASTER or REPLICATEDMASTER instead of using the ambiguous master keyword.
  • Example syntax:
 RESTORE DATABASE PHYSMASTER FROM DISK = 'C:\Backups\master.bak' WITH REPLACE;
  • If working with replication topology, use:
 ALTER DATABASE REPLICATEDMASTER SET RECOVERY FULL;
  • Avoid using generic T-SQL scripts or legacy automation jobs that hardcode master without specifying context, as these are the primary cause of ambiguity in SQL 2025.

Step 3: Check and Update Replication/Mirroring Metadata

  • Open SQL Server Configuration Manager and verify the Fabric Mirroring endpoint settings under SQL Server Services > Protocols.
  • Run the following query to check for duplicate master references in the system metadata:
 SELECT name, database_id, replica_id FROM sys.databases WHERE name LIKE '%master%';
  • If a duplicate or orphaned replica_id is found, remove the stale reference using sp_dropdistributor or the Always On Availability Group Wizard in SSMS.

Step 4: Restart the SQL Server Service

  • Open Services.msc on Windows Server 2025 or Windows 11.
  • Restart the SQL Server (MSSQLSERVER) service to clear any cached ambiguous resolution states.
  • Monitor the ERRORLOG during startup to confirm the ambiguity warning does not reappear.

Alternative or Verification Steps

  • Verify the fix by re-running the original failed action (e.g., restore or alter command) and confirming Error 3273 no longer appears in the SQL Server Error Log or Windows Event Viewer (Event ID 3273 under Applications and Services Logs > MSSQLSERVER).
  • If the error persists, use DBCC TRACEON (3273, -1) temporarily to force verbose diagnostic output, which will explicitly list both PHYSMASTER and REPLICATEDMASTER paths for manual selection.

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

Troubleshooting Guide: SQL Server Error 3271 — “A Nonrecoverable I/O Error Occurred on File”

Why This Error Happens

Error 3271 occurs when SQL Server’s I/O subsystem fails to read from or write to a database file due to a low-level disk, controller, or filesystem fault that cannot be retried or recovered automatically. This is commonly caused by underlying storage hardware failure, a corrupted NTFS/ReFS volume, antivirus or backup software locking the file, or the storage path becoming unavailable (e.g., disconnected SAN/NAS, dismounted volume). It can also surface during backup or restore operations when the destination device runs out of space or loses connectivity mid-operation.

Step-by-Step Resolution Guide

Step 1: Identify the Affected File and Check SQL Server Error Log

  • Open SQL Server Management Studio (SSMS) and run: EXEC sp_readerrorlog 0, 1, '3271';
  • Note the exact file path (%ls) and the OS-level error message (%ls) reported alongside Error 3271.
  • Cross-reference the timestamp with Windows Event Viewer under Windows Logs > System and Application for Disk, Ntfs, or VDS warnings.

Step 2: Verify Disk and Volume Health

  • Open an elevated Command Prompt and run: chkdsk D: /f /r (replace D: with the actual drive hosting the .mdf/.ldf/.bak file).
  • Check physical disk status via Get-PhysicalDisk | Select DeviceId, HealthStatus, OperationalStatus in PowerShell.
  • If using Storage Spaces or a SAN/NAS, confirm the LUN or virtual disk is online and not in a degraded/predictive-failure state using Server Manager > File and Storage Services.

Step 3: Confirm File Accessibility and Permissions

  • Ensure the SQL Server service account (e.g., NT Service\MSSQLSERVER or a custom domain account) has full read/write permissions on the data folder (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA).
  • Confirm no other process (antivirus, backup agent, or file indexing service) has an exclusive lock on the .mdf/.ndf/.ldf file by checking with Resource Monitor > Disk tab.
  • Add SQL Server data/log directories to your antivirus exclusion list to prevent file-locking conflicts during I/O operations.

Step 4: Restore or Repair the Affected Database

  • If the file is confirmed corrupted and the disk hardware is healthy, take the database offline: ALTER DATABASE [YourDB] SET OFFLINE;
  • Restore from the most recent clean backup: RESTORE DATABASE [YourDB] FROM DISK = 'E:\Backups\YourDB.bak' WITH REPLACE, RECOVERY;
  • If no clean backup exists, attempt DBCC CHECKDB ('YourDB', REPAIR_ALLOW_DATA_LOSS) only as a last resort, after taking a full file-level backup of the current state.

Step 5: Relocate Database Files to Healthy Storage

  • If the underlying volume is failing, move data/log files to a new healthy disk using: ALTER DATABASE [YourDB] MODIFY FILE (NAME = YourDB_Data, FILENAME = 'F:\SQLData\YourDB.mdf');
  • Take the database offline, physically move the files via Move-Item, then bring it back online with ALTER DATABASE [YourDB] SET ONLINE;

Alternative or Verification Steps

  • Run DBCC CHECKDB ('YourDB') WITH NO_INFOMSGS, ALL_ERRORMSGS; to confirm the database is fully consistent and no further I/O errors are logged.
  • Monitor the SQL Server error log and Windows Event Viewer for 24–48 hours post-fix; if Error 3271 recurs on the same physical disk, replace the storage hardware rather than continuing repairs at the software layer.

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

Troubleshooting Guide: SQL Server Error 3272 — Hardware Sector Size Mismatch

Why This Error Happens

This error occurs when SQL Server 2025 detects that the underlying storage device reports a hardware sector size that is incompatible with the sector size expected for database file I/O operations, typically during backup, restore, or database file creation. It is most commonly triggered by Advanced Format (4Kn) disks, misconfigured storage arrays, virtual disk emulation layers, or SAN/NAS devices that report inconsistent or non-standard sector sizes to the OS. This mismatch prevents SQL Server from performing aligned, unbuffered I/O correctly, causing the operation to fail rather than risk data corruption.

Step-by-Step Resolution Guide

Step 1: Identify the Actual Hardware Sector Size

  • Open PowerShell as Administrator and run Get-PhysicalDisk | Get-StorageAdvancedProperty to check PhysicalSectorSize and LogicalSectorSize values.
  • Alternatively, run fsutil fsinfo sectorinfo <DriveLetter>: to view PhysicalBytesPerSectorForAtomicity and LogicalBytesPerSector.
  • Note any mismatch between physical (often 4096 bytes) and logical (often 512 bytes) sector sizes reported by the device.

Step 2: Reconfigure the Target Volume with Matching Allocation Unit Size

  • Back up any existing data on the affected volume before proceeding.
  • Reformat the volume using an allocation unit size that aligns with the hardware sector size, e.g., Format-Volume -DriveLetter E -FileSystem NTFS -AllocationUnitSize 4096 -NewFileSystemLabel "SQLData".
  • For NAS/iSCSI/SAN-backed storage, confirm with your storage vendor that the LUN is presented as 4Kn or 512e consistently across the host, HBA driver, and multipath software.

Step 3: Update Storage Drivers and Firmware

  • Navigate to Device Manager > Disk Drives > right-click the affected device > Update Driver, or download the latest storage controller driver directly from the vendor (Dell, HPE, Broadcom, etc.).
  • Apply any pending firmware updates to the RAID controller, HBA, or SAN array, since outdated firmware frequently misreports sector geometry to Windows Server 2025.
  • Reboot the server after driver/firmware updates to ensure the new sector size reporting takes effect.

Step 4: Relocate Database Files to a Compatible Volume

  • Use ALTER DATABASE [YourDB] MODIFY FILE in SQL Server Management Studio to point data/log files to the newly formatted, correctly aligned volume.
  • Move the physical .mdf/.ldf/.bak files to the new path using Windows file operations while the SQL Server service is stopped.
  • Restart the SQL Server service via services.msc or net start MSSQLSERVER and verify the database comes back online.

Step 5: Adjust Backup/Restore Target if Error Persists on Backup Operations

  • If the error specifically occurs during BACKUP DATABASE or RESTORE DATABASE, redirect the backup destination to a local disk or validated SAN LUN with matching sector size.
  • Add the WITH BLOCKSIZE = 4096 option explicitly in your T-SQL backup command to force a compatible block size, e.g., BACKUP DATABASE [YourDB] TO DISK = 'E:\Backups\YourDB.bak' WITH BLOCKSIZE = 4096.

Alternative or Verification Steps

  • Run a test backup and restore cycle (BACKUP DATABASE ... WITH CHECKSUM followed by RESTORE VERIFYONLY) on the reconfigured volume to confirm Error 3272 no longer appears in the SQL Server Error Log or Windows Event Viewer.
  • If the error persists despite reformatting, test writing the database files to a different physical volume or local SSD temporarily to isolate whether the issue is storage-hardware-specific versus a SQL Server configuration problem.

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

Troubleshooting Guide: SQL Server Error 3270 — Internal Consistency Error

Why This Error Happens

Error 3270 is a generic internal assertion failure raised by the SQL Server Database Engine when it detects that an internal data structure, page, or metadata object does not match its expected state. This is most commonly triggered by backup/restore operations (especially BACKUP or RESTORE VERIFYONLY) encountering corrupted database pages, damaged backup media, or inconsistencies caused by abrupt shutdowns, faulty storage hardware, or bugs exposed during an in-place upgrade to SQL Server 2025. Because it behaves like a debug assert, it almost always points to either physical corruption on disk or an edge-case engine defect rather than a simple configuration mistake.

Step-by-Step Resolution Guide

Step 1: Confirm the Scope and Capture Diagnostic Details

  • Open the SQL Server Error Log (Management > SQL Server Logs in SSMS) and locate the full text of the 3270 message, including any accompanying stack or location string (e.g., Location:, Expression:, or SPID: values).
  • Check the Windows Event Viewer under Applications and Services Logs > MSSQLSERVER for correlated I/O or disk warnings (Event ID 823, 824, or 825).
  • Note the exact operation that triggered the error (e.g., BACKUP DATABASE, RESTORE, DBCC CHECKDB, or a routine query) since this determines whether the issue is media-based or page-based.

Step 2: Run Integrity Checks on the Database and Backup Media

  • Execute DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to identify any page-level corruption.
  • If the error occurred during a backup, validate the backup set using:
  RESTORE VERIFYONLY FROM DISK = 'D:\Backups\YourDatabase.bak';
  • If corruption is confirmed, check the underlying storage subsystem (SAN, RAID controller, or virtual disk) for hardware-level faults using Windows Server 2025’s Storage > Reliability Monitor or chkdsk D: /f /r.

Step 3: Apply the Latest Cumulative Update and Rebuild Affected Objects

  • Download and install the latest Cumulative Update (CU) for SQL Server 2025 from the Microsoft Update Catalog, since Error 3270 is frequently patched as a known engine defect in early release builds.
  • After patching, re-run the failed operation (backup, restore, or query) to confirm whether the CU resolves the assertion.
  • If specific tables or indexes were flagged by DBCC CHECKDB, rebuild them using:
  ALTER INDEX ALL ON dbo.YourTable REBUILD;

Step 4: Restore From a Known-Good Backup if Corruption Persists

  • If DBCC CHECKDB reports unrepairable corruption, restore the database from the most recent verified clean backup to a test instance first.
  • Use RESTORE DATABASE YourDatabaseName FROM DISK = 'D:\Backups\YourDatabase_Clean.bak' WITH REPLACE, RECOVERY; on the test instance.
  • Validate the restored copy with another DBCC CHECKDB pass before promoting it to production.

Alternative or Verification Steps

  • Re-run the original operation (backup, restore, or query) that triggered Error 3270 — a clean completion with no assertion message confirms the fix.
  • If the error persists after patching and integrity checks pass clean, open a Microsoft Support (CSS) case and attach the SQL Server Error Log, a memory dump if generated (LOG\SQLDump*.mdmp in the SQL Server install directory), and the output of DBCC CHECKDB, as 3270 errors tied to engine bugs typically require a hotfix.

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

Why This Error Happens

This error occurs because SQL Server backup files store metadata about the physical sector size of the device they were originally written to, and this value is validated during restore operations. When the backup media (originally written on a device with 512-byte or 4K sector alignment) is restored to a target device with a different sector size, SQL Server blocks the operation to prevent data corruption or I/O misalignment. This commonly happens when backups are moved between physical disks, SANs, virtual disks, or cloud storage (such as Azure Blob or VHDX-based volumes) that use Advanced Format (4Kn) drives instead of legacy 512-byte emulation (512e) drives.

Step-by-Step Resolution Guide

Step 1: Identify the Sector Size Mismatch

  • Run fsutil fsinfo sectorinfo <DriveLetter>: in an elevated Command Prompt on both the source and target systems.
  • Compare the “Physical Bytes Per Sector” and “Logical Bytes Per Sector” values reported in the error message (%d and %d) to confirm the mismatch.
  • Note the exact file path referenced in the error (%ls) to confirm which backup file is affected.

Step 2: Restore Using a Compatible Intermediate Location

  • Copy the .bak or .trn file to a storage volume that matches the original sector size (e.g., move from a 4Kn NVMe drive to a 512e-formatted volume).
  • Use Robocopy or standard file copy tools rather than streaming the restore directly from the mismatched device.
  • Re-run the restore command once the file resides on compatible media:
  RESTORE DATABASE [YourDB] FROM DISK = 'D:\SQLBackups\YourDB.bak' WITH RECOVERY;

Step 3: Reformat or Reprovision the Target Disk

  • If the target server’s storage was provisioned with 4Kn sector size (common on newer NVMe/SSD hardware in Windows Server 2025), reformat the target volume using 512e emulation if your storage controller supports it.
  • In Disk Management or via PowerShell, check disk properties with:
  Get-PhysicalDisk | Select FriendlyName, PhysicalSectorSize, LogicalSectorSize
  • Reprovision the disk through your storage vendor’s management tool (SAN/NAS controller) to force 512e mode if 4Kn is not required for performance reasons.

Step 4: Use a Staging VM or Network Share as a Workaround

  • If reformatting is not feasible, stage the backup file on a network share (SMB) that abstracts the underlying sector size.
  • Perform the restore from the UNC path instead of a local 4Kn-formatted disk:
  RESTORE DATABASE [YourDB] FROM DISK = '\\FileServer\Backups\YourDB.bak' WITH RECOVERY;

Alternative or Verification Steps

  • After applying the fix, verify success by checking SQL Server Error Logs or re-running RESTORE HEADERONLY FROM DISK = '<path>' to confirm the file reads without triggering Error 3269.
  • As an alternative, use BACKUP DATABASE with COPY_ONLY on a 512e-compatible source system to generate a new backup file that matches the sector size of your current infrastructure.

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

Troubleshooting Guide: SQL Server Error 3268 — Backup Sector Size Mismatch

Why This Error Happens

This error occurs because SQL Server backup files store metadata about the physical sector size of the disk device they were originally written to, and it validates this value during restore operations. When the original backup media (often older disks or specific SAN/NAS configurations) used a different sector size—typically 512 bytes—than the current target device, which may use 4096-byte (4Kn) sectors, SQL Server blocks the restore to prevent data corruption. This mismatch commonly arises when backups are moved between different storage hardware, virtualized disks, or cloud storage accounts with varying Advanced Format disk configurations.

Step-by-Step Resolution Guide

Step 1: Verify the Sector Size of Source and Target Devices

  • Open PowerShell as Administrator and run fsutil fsinfo sectorinfo <DriveLetter>: on both the original and target storage paths.
  • Compare the LogicalBytesPerSector and PhysicalBytesPerSector values to confirm the actual mismatch reported in the error.
  • Note the drive type (SSD, SAN LUN, Azure Disk, etc.) since cloud-based storage often defaults to 4Kn.

Step 2: Restore Using the WITH BLOCKSIZE Override

  • Open SQL Server Management Studio (SSMS) and connect to the target instance.
  • Run the restore command with an explicit block size parameter to force compatibility:
  RESTORE DATABASE [YourDatabase]
  FROM DISK = N'D:\Backups\YourBackup.bak'
  WITH BLOCKSIZE = 65536, REPLACE;
  • If BLOCKSIZE alone does not resolve it, add MAXTRANSFERSIZE = 2097152 to further align I/O operations with the new sector size.

Step 3: Copy the Backup File to a Matching Sector-Size Volume

  • Identify or provision a temporary volume formatted with the same sector size as the original backup (e.g., 512-byte emulation).
  • Use Format-Volume -DriveLetter X -FileSystem NTFS -LogicalSectorSizeBytes 512 (via PowerShell, on supported hardware) or provision a VHD/VHDX with matching sector size using Hyper-V Manager.
  • Copy the .bak file to this intermediary volume and re-attempt the restore from there before moving the restored database to its final production storage.

Step 4: Re-Export the Backup from Source if Possible

  • If the original source server is still accessible, take a fresh BACKUP DATABASE on the source using WITH COMPRESSION to normalize the sector dependency.
  • Transfer this newly created backup file to the Windows Server 2025 target and retry the restore without needing BLOCKSIZE overrides.

Alternative or Verification Steps

  • After applying Step 2 or Step 3, confirm success by checking that RESTORE DATABASE completes without Error 3268 and the database appears as Online in SSMS Object Explorer.
  • As an alternative, mount the backup file via a virtual drive (VHD/VHDX) explicitly created with -LogicalSectorSizeBytes 512 in Hyper-V, which bypasses physical disk sector constraints entirely.

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

Troubleshooting Guide: SQL Server Error 3266

Why This Error Happens

Error 3266 occurs when SQL Server reads the backup media and encounters a trailer or end-of-data block that doesn’t match the expected format, indicating the backup file is truncated, corrupted, or was not closed properly during the original backup operation. This frequently happens due to network interruptions during the backup write process, disk I/O errors on the storage device hosting the .bak file, antivirus software locking or modifying the file mid-write, or manual truncation of the file (e.g., copying it before the backup job fully completed). It can also occur if multiple backup sets were appended to the same media file and one of the intermediate sets was corrupted, breaking the chain for subsequent reads.

Step-by-Step Resolution Guide

Step 1: Verify the Integrity of the Backup File

  • Check the file size of the .bak file against the expected size logged in the SQL Server Agent job history or backup history tables (msdb.dbo.backupset).
  • Run RESTORE VERIFYONLY FROM DISK = 'C:\Backups\YourFile.bak' in SQL Server Management Studio (SSMS) to confirm if the header is readable even if the end is corrupt.
  • Check the Windows Event Viewer under Windows Logs > System for Disk or NTFS errors (Event ID 7 or 55) that occurred at the timestamp of the backup job.

Step 2: Isolate Specific Backup Sets on the Media

  • If the backup file contains multiple sets (appended backups), attempt to isolate the specific corrupted set rather than discarding the whole file.
  • Run RESTORE HEADERONLY FROM DISK = 'C:\Backups\YourFile.bak' to list all available backup sets and their position numbers.
  • Attempt to restore a specific earlier set using the FILE = parameter, for example: RESTORE DATABASE [YourDB] FROM DISK = 'C:\Backups\YourFile.bak' WITH FILE = 1, NORECOVERY;

Step 3: Check for Storage and Network Interruptions

  • If the backup resides on a Network Attached Storage (NAS) or SMB share, verify the stability of the network path by checking for packet loss between the Windows Server 2025 host and the storage target.
  • Navigate to Server Manager > Tools > Event Viewer > Applications and Services Logs > Microsoft > Windows > SMBClient to check for connectivity drops during the backup window.
  • Ensure the antivirus software (e.g., Windows Defender) has an exclusion rule for the SQL Server backup directory (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\) to prevent file locking during the write process.

Step 4: Rebuild the Backup Strategy to Prevent Recurrence

  • If the file is confirmed unusable, switch the backup destination to a local, high-speed SSD/NVMe volume temporarily to rule out network-based corruption.
  • Update the SQL Server Agent job step to include a CHECKSUM option in the backup command: BACKUP DATABASE [YourDB] TO DISK = 'C:\Backups\YourFile.bak' WITH CHECKSUM, STATS = 10;
  • This ensures future backups fail immediately upon write-corruption rather than creating a “silently” broken file that fails later during a restore.

Alternative or Verification Steps

  • Verification: After identifying a usable backup set via HEADERONLY, successfully restore it to a test database instance using RESTORE DATABASE [TestDB] FROM DISK = '...' WITH REPLACE, RECOVERY; to confirm data consistency before relying on it for production recovery.
  • Alternative: If the primary backup file is fully unusable and no prior backup set is valid, check for a Volume Shadow Copy Service (VSS) snapshot or a Storage Area Network (SAN) level snapshot taken around the same time, as these bypass the SQL Server backup stream entirely and may provide a clean recovery point.

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

Troubleshooting Guide: Error 3267 — Insufficient Resources to Create UMS Scheduler (SQL Server 2025)

Why This Error Happens

This error occurs when SQL Server’s User Mode Scheduler (UMS) cannot allocate a new scheduler during startup or under heavy connection load, typically due to insufficient system memory, exhausted worker thread pools, or a misconfigured max worker threads / affinity mask setting. It can also arise when the OS denies the SQL Server service account the memory pages or handles required to initialize schedulers, often because of restrictive Lock Pages in Memory policies or virtual memory exhaustion on Windows Server 2025 / Windows 11. In virtualized or containerized deployments, CPU core misreporting (NUMA/vCPU mismatch) can also trigger this failure.

Step-by-Step Resolution Guide

Step 1: Verify System Memory and Resource Availability

  • Open Task Manager or Performance Monitor and check available physical memory and committed bytes.
  • Ensure the host/VM has not hit memory ballooning limits (common in Hyper-V or Azure VM configurations).
  • Run DBCC MEMORYSTATUS in SSMS to inspect SQL Server’s internal memory allocation and scheduler count.

Step 2: Check and Adjust Max Worker Threads Configuration

  • Open SQL Server Management Studio (SSMS) and run:
  EXEC sp_configure 'max worker threads';
  • If the value is manually set too low or too high relative to CPU count, reset it to 0 (auto-configure):
  EXEC sp_configure 'show advanced options', 1;
  RECONFIGURE;
  EXEC sp_configure 'max worker threads', 0;
  RECONFIGURE;
  • Restart the SQL Server service for changes to take effect.

Step 3: Validate Affinity Mask and NUMA Configuration

  • Navigate to SQL Server Configuration Manager → SQL Server service properties → Advanced tab.
  • Confirm the affinity mask and affinity64 mask settings align with the actual number of logical processors exposed by Windows Server 2025 / Windows 11.
  • If using NUMA, verify node configuration matches hardware topology using:
  SELECT * FROM sys.dm_os_nodes;

Step 4: Grant Required Memory and Security Permissions

  • Open Local Security Policy (secpol.msc) on the host machine.
  • Navigate to Local Policies → User Rights Assignment → Lock Pages in Memory.
  • Ensure the SQL Server service account is added to this policy, then restart the SQL Server (MSSQLSERVER) service.

Step 5: Review SQL Server Error Log for Correlating Events

  • Locate the error log at:
  C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG
  • Search for preceding messages related to Out of memory, WorkerPool, or Node configuration to pinpoint the exact resource constraint.

Alternative or Verification Steps

  • After applying fixes, restart the SQL Server service and confirm successful scheduler initialization by running SELECT * FROM sys.dm_os_schedulers; — all schedulers should show status VISIBLE ONLINE.
  • If the issue persists, consider increasing the VM/host’s allocated vCPUs or physical RAM, or migrating the instance to a host with dedicated (non-shared) CPU resources.

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

Troubleshooting Guide: SQL Server Error 3265 — Insufficient Authority for VIRTUAL_DEVICE

Why This Error Happens

This error occurs because the SQL Server login attempting to execute a BACKUP or RESTORE operation using a VIRTUAL_DEVICE (commonly invoked by third-party backup tools or SQL Virtual Device Interface applications) does not hold membership in the fixed sysadmin server role. Microsoft SQL Server 2025 enforces strict role validation for VDI operations because virtual devices interact directly with low-level I/O streams, requiring elevated trust. This is frequently seen when a service account used by backup software (e.g., Veeam, Commvault, or custom SQLVDI clients) was provisioned with only db_backupoperator or limited server-level permissions instead of full sysadmin rights.

Step-by-Step Resolution Guide

Step 1: Identify the Login Being Used

  • Open the failing backup job log or Windows Event Viewer and locate the exact SQL Server login/service account triggering Error 3265.
  • Check the backup software configuration panel (e.g., “SQL Server Connection Settings”) to confirm which account initiates the VDI session.
  • Run the following query in SQL Server Management Studio (SSMS) to confirm current role memberships:
  SELECT IS_SRVROLEMEMBER('sysadmin', 'DOMAIN\ServiceAccount');

Step 2: Grant Sysadmin Role Membership

  • Open SQL Server Management Studio (SSMS) and connect to the instance using an account with sysadmin privileges.
  • Navigate to Security > Logins, right-click the affected login, and select Properties.
  • Under the Server Roles page, check the box next to sysadmin, then click OK.
  • Alternatively, run the following T-SQL command:
  ALTER SERVER ROLE sysadmin ADD MEMBER [DOMAIN\ServiceAccount];

Step 3: Restart the SQL Server Service

  • Open Services.msc on Windows Server 2025 / Windows 11.
  • Locate SQL Server (MSSQLSERVER) or the named instance service.
  • Right-click and select Restart to ensure the new role membership is fully applied to active sessions.
  • If using a clustered or Always On Availability Group setup, restart services on all nodes hosting the instance.

Step 4: Validate Backup Software Service Account Configuration

  • Open the backup application’s configuration console (e.g., Veeam Backup & Replication, Commvault, or custom VDI script).
  • Confirm the account used in Step 1 matches exactly the login granted sysadmin in Step 2 (check for domain vs. local account mismatches).
  • Re-enter credentials if necessary and save the configuration to refresh the authentication token.

Alternative or Verification Steps

  • Re-run the failed backup or restore job and monitor SQL Server Error Logs (SSMS > Management > SQL Server Logs) to confirm Error 3265 no longer appears.
  • If sysadmin escalation is restricted by security policy, consider using a dedicated backup proxy account with temporary sysadmin rights only during the backup window, then revoke access afterward using ALTER SERVER ROLE sysadmin DROP MEMBER [DOMAIN\ServiceAccount];.

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

Troubleshooting Guide: SQL Server Error 3264 – “RESTART Qualifier” Failure

Why This Error Happens

Error 3264 occurs when a RESTORE command is issued with the WITH RESTART option, but SQL Server cannot find a valid checkpoint from a previously interrupted restore operation to resume from. This typically happens because the prior restore was cancelled too early (before SQL Server wrote an internal restart checkpoint to msdb), the restore operation actually completed successfully before being reissued, or the msdb restart history was cleared/corrupted between attempts. Essentially, SQL Server 2025 has no “bookmark” to pick up from, making the RESTART qualifier invalid for that specific restore sequence.

Step-by-Step Resolution Guide

Step 1: Reissue the Restore Without the RESTART Qualifier

  • Open SQL Server Management Studio (SSMS) or your query tool connected to the Windows Server 2025 / Windows 11 instance.
  • Remove WITH RESTART from your T-SQL statement and run the restore from the beginning:
  • RESTORE DATABASE [YourDB] FROM DISK = N'C:\Backups\YourDB.bak' WITH REPLACE, STATS = 5;
  • This forces a fresh, full restore pass instead of attempting to resume a nonexistent checkpoint.

Step 2: Verify the Backup File Integrity

  • Confirm the .bak file is not truncated, corrupted, or still locked by another process (check Task Manager for lingering sqlservr.exe handles).
  • Run a verification check before restoring:
  • RESTORE VERIFYONLY FROM DISK = N'C:\Backups\YourDB.bak';
  • If verification fails, obtain a fresh backup copy from the source system or backup repository.

Step 3: Check and Clear Stale Restore History in msdb

  • Query the msdb.dbo.restorehistory table to confirm whether a valid restart checkpoint actually exists for this database.
  • SELECT * FROM msdb.dbo.restorehistory WHERE destination_database_name = 'YourDB' ORDER BY restore_date DESC;
  • If no valid incomplete entry is found (or the last entry shows a completed restore), this confirms RESTART has no valid state to resume — proceed with a full restore instead.

Step 4: Confirm Sufficient Disk Space and Permissions

  • Ensure the SQL Server service account has read/write access to both the backup source folder and the target data/log file directories (commonly C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).
  • Check available disk space on the drive hosting the .mdf/.ldf files — insufficient space can cause the restore to silently abort before writing a restart checkpoint, triggering this error on retry.
  • Use File Explorer or PowerShell (Get-PSDrive) to confirm free space exceeds the backup file size by at least 1.5x.

Alternative or Verification Steps

  • After reissuing the restore without RESTART, monitor progress via SELECT percent_complete, estimated_completion_time FROM sys.dm_exec_requests WHERE command = 'RESTORE DATABASE'; to confirm it completes without aborting.
  • If the issue persists across multiple attempts, use WITH NORECOVERY to break the restore into separate full/differential/log steps, which avoids RESTART dependency entirely for staged restore sequences.

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

Why This Error Happens

Error 3262 is generated by the SQL Server backup/restore engine when it performs a checksum validation pass (via BACKUP ... WITH CHECKSUM or RESTORE VERIFYONLY) and detects that the backup media header reports a valid set, yet the underlying page checksums were skipped, mismatched, or partially unreadable due to media-level corruption. This typically occurs because the backup file was written to an unstable storage target—such as a network share with intermittent connectivity, a USB/external drive with write-caching issues, or a volume with disk-level errors—causing bit-level corruption that the SQL Server engine flags inconsistently. It can also surface when antivirus or backup-agent software locks or modifies the .bak file mid-write, resulting in a backup set that passes header validation but fails deeper integrity checks.

Step-by-Step Resolution Guide

Step 1: Verify the Integrity of the Backup File

  • Run RESTORE VERIFYONLY FROM DISK = 'D:\Backups\YourDB.bak' WITH CHECKSUM; in SSMS to confirm whether checksum errors are reported alongside the 3262 message.
  • Check the SQL Server Error Log (ERRORLOG in C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\) for accompanying Error 3183 or 3241, which indicate true corruption versus a benign informational notice.

Step 2: Rule Out Storage and Network Instability

  • Move the backup destination off any SMB/network share and test writing directly to local storage (e.g., E:\SQLBackups\) to eliminate network packet loss as a cause.
  • Run chkdsk E: /f /r on the backup volume in an elevated Command Prompt to detect and repair underlying disk sector errors.
  • Confirm the storage controller/driver is up to date via Device Manager on Windows Server 2025/Windows 11.

Step 3: Exclude Antivirus and Backup Agent Interference

  • Add an exclusion for the SQL Server backup directory (e.g., D:\Backups\*.bak) and the sqlservr.exe process in Windows Defender or your third-party AV console.
  • Disable any third-party backup agent (e.g., Veeam, Commvault) temporarily and re-run a native BACKUP DATABASE ... WITH CHECKSUM to see if the error disappears.

Step 4: Re-run the Backup with CHECKSUM and Full Logging

  • Execute: BACKUP DATABASE YourDB TO DISK = 'D:\Backups\YourDB_Full.bak' WITH CHECKSUM, STOP_ON_ERROR;
  • If the backup completes without the 3262 message, archive the old corrupted file and replace all downstream backup jobs with the new, verified set.

Step 5: Update SQL Server and Apply Latest Cumulative Update

  • Open SQL Server Setup, check Help > About for current build, and install the latest Cumulative Update for SQL Server 2025 from the Microsoft Update Catalog, as checksum-reporting bugs are occasionally patched in CU releases.

Alternative or Verification Steps

  • After remediation, run RESTORE VERIFYONLY FROM DISK = 'D:\Backups\YourDB_Full.bak' WITH CHECKSUM; and confirm the output only shows the benign “backup set is valid” message with no accompanying error codes (3183/3241).
  • As an alternative, perform a full RESTORE DATABASE ... WITH REPLACE to a test instance to confirm the backup is restorable end-to-end, which is the most reliable verification that no page-level corruption exists.

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

Troubleshooting Guide: SQL Server Error 3263 – Cannot Use Volume as Continuation Volume

Why This Error Happens

This error occurs when SQL Server attempts to continue a backup or restore operation across multiple volumes (tapes, disk files, or backup devices) but detects that the volume inserted does not match the expected sequence number or media family for the current media set. This typically happens due to incorrect volume ordering, a mismatched or corrupted backup media header, or when a backup file from a different media set/family is mistakenly substituted mid-operation. It can also occur if backup files were manually renamed, moved, or if a multi-file backup striping configuration was altered after the backup set was initiated.

Step-by-Step Resolution Guide

Step 1: Verify the Correct Volume Sequence

  • Check the original backup command or script to confirm the exact order of backup devices/files used (e.g., BACKUP DATABASE ... TO DISK = 'File1.bak', DISK = 'File2.bak').
  • Run RESTORE LABELONLY FROM DISK = 'Path\File.bak' to inspect the media set, family sequence number, and volume ID stored in the header.
  • Ensure the volume you are inserting matches the FamilySequenceNumber and MediaSequenceNumber expected by SQL Server.

Step 2: Confirm File Integrity and Correct Media Family

  • Navigate to the backup directory, typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\, and verify all striped backup files are present and untouched.
  • Use RESTORE VERIFYONLY FROM DISK = 'Path\File1.bak', DISK = 'Path\File2.bak' to validate the entire media set as a whole, not just a single file.
  • If any file was renamed or copied from a different backup job, restore using the original, unaltered files instead.

Step 3: Reissue the Restore or Backup Command with Correct Volume Order

  • Reconstruct the RESTORE DATABASE or BACKUP DATABASE statement, explicitly listing all DISK = or TAPE = entries in their original creation order.
  • Example:
  RESTORE DATABASE [YourDB]
  FROM DISK = 'D:\Backups\File1.bak',
       DISK = 'D:\Backups\File2.bak'
  WITH FILE = 1;
  • If using tape devices, ensure the correct physical tape is loaded and that the tape drive is not reporting a different volume ID.

Step 4: Restart the Backup/Restore Job with a Fresh Media Set

  • If the media set is irreparably mismatched, initiate a brand-new backup set using WITH FORMAT to avoid contaminated sequence metadata.
  • Update any SQL Server Agent Job steps or maintenance plans referencing the old file paths to point to the newly created backup set.
  • Restart the SQL Server Agent service via Services.msc on Windows Server 2025 if the job scheduler cached old device metadata.

Alternative or Verification Steps

  • Run RESTORE HEADERONLY FROM DISK = 'Path\File.bak' after applying the fix to confirm the MediaSequenceNumber and FamilyCount align correctly before attempting a full restore.
  • If the issue persists across multiple attempts, consider migrating the backup strategy to a single consolidated .bak file (non-striped) to eliminate multi-volume sequencing errors entirely.

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

Troubleshooting Guide: SQL Server Error 3261 — “Cannot Use the Virtual Device Configuration”

Why This Error Happens

Error 3261 typically occurs when SQL Server’s backup or restore operation fails to communicate properly with the Virtual Device Interface (VDI), often due to a mismatched or corrupted VDI configuration string passed by the backup application. This can also result from insufficient permissions on the SQL Server service account to access the shared memory or named pipes used by the Virtual Backup Device, or from a conflict caused by an outdated/incompatible VDI DLL (sqlvdi.dll) version. Additionally, third-party backup tools that fail to release virtual device handles properly can leave orphaned VDI sessions that block new configurations.

Step-by-Step Resolution Guide

Step 1: Verify and Repair the VDI Component Registration

  • Navigate to C:\Program Files\Microsoft SQL Server\160\Shared\ (adjust version path for SQL Server 2025 build) and confirm sqlvdi.dll exists.
  • Re-register the DLL using an elevated Command Prompt: regsvr32 "C:\Program Files\Microsoft SQL Server\160\Shared\sqlvdi.dll".
  • Restart the SQL Server (MSSQLSERVER) service via services.msc after registration completes.

Step 2: Check and Correct Service Account Permissions

  • Open Component Services (dcomcnfg.exe) and navigate to Component Services > Computers > My Computer > DCOM Config.
  • Locate the SQL Server VDI entry and ensure the SQL Server service account has Local Launch and Local Activation permissions.
  • Confirm the account also has Full Control on C:\Windows\Temp since VDI uses this path for shared memory mapping files.

Step 3: Terminate Orphaned VDI Sessions and Processes

  • Open Task Manager or PowerShell and check for hung sqlservr.exe or third-party backup agent processes (e.g., Veeam, NetBackup, CommVault agents).
  • Run Get-Process | Where-Object {$_.Name -like "*vdi*"} in PowerShell to identify lingering virtual device handles.
  • Kill any stuck processes and retry the backup/restore operation immediately afterward, as VDI sessions are time-sensitive.

Step 4: Update SQL Server and Backup Software Compatibility

  • Apply the latest Cumulative Update (CU) for SQL Server 2025 from the Microsoft Update Catalog, as early builds may have known VDI handshake bugs.
  • Verify your third-party backup software (if used) explicitly lists compatibility with SQL Server 2025 and Windows Server 2025/Windows 11.
  • If using Native SQL Backup, test without third-party tools to isolate whether the issue is software-specific.

Alternative or Verification Steps

  • Run a manual native backup via T-SQL (BACKUP DATABASE [YourDB] TO DISK = 'C:\Backup\test.bak') to confirm Error 3261 no longer appears outside of third-party tools.
  • If the error persists, check the Windows Event Viewer (Application log) for correlating VSS or VDI timeout errors, and consider increasing the VDI timeout value in your backup software’s advanced configuration settings.

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

Troubleshooting Guide: SQL Server Error 3260 — “An Internal Buffer Has Become Full”

Why This Error Happens

Error 3260 typically occurs during BACKUP or RESTORE operations when SQL Server’s internal message buffer, used to format output strings (such as file paths or device names), exceeds its allocated size limit. This is most commonly triggered by excessively long file paths, overly verbose backup device names, or an accumulation of long error strings being concatenated into a single buffer during logging. In rare cases, it can also surface due to corrupted metadata in the backup history tables (msdb.dbo.backupset, backupfile) that causes malformed string generation.

Step-by-Step Resolution Guide

Step 1: Shorten File Paths and Device Names

  • Check the full path of your backup/restore target; Windows Server 2025 and SQL Server 2025 still respect legacy buffer limits even though NTFS supports long paths.
  • Move backup destinations to a shorter root path, e.g., from D:\SQLData\ProductionBackups\2025\DailyFull\ to D:\Backups\.
  • Avoid deeply nested UNC paths like \\FileServer01\SQLBackups\Department\Finance\2025\Q4\; shorten to \\FileServer01\Backups\.

Step 2: Clear and Rebuild Backup History Metadata

  • Open SQL Server Management Studio (SSMS) and connect to the instance via a new query window.
  • Run EXEC msdb.dbo.sp_delete_backuphistory @oldest_date = '2024-01-01'; to purge outdated backup history entries that may be corrupted or bloated.
  • Restart the SQL Server service via services.msc or run Restart-Service -Name 'MSSQLSERVER' in an elevated PowerShell session on Windows Server 2025.

Step 3: Split Backup Operations Across Multiple Smaller Devices

  • Instead of a single large backup command with many device files listed, break the BACKUP DATABASE statement into fewer striped files with shorter names.
  • Example: Replace BACKUP DATABASE MyDB TO DISK = 'D:\VeryLongDescriptiveBackupFileNameForMyDatabase.bak' with BACKUP DATABASE MyDB TO DISK = 'D:\MyDB.bak'.
  • Avoid using excessive WITH clause options in a single statement that generate long internal message strings (e.g., combining NAME, DESCRIPTION, and MEDIANAME with long text values).

Step 4: Apply Latest Cumulative Update for SQL Server 2025

  • Check the current build version using SELECT @@VERSION; in SSMS.
  • Download and install the latest Cumulative Update (CU) from the Microsoft Update Catalog, as buffer-handling bugs are frequently patched in CUs.
  • Reboot the Windows Server 2025 host after installation to ensure all binaries are correctly refreshed.

Alternative or Verification Steps

  • Re-run the original BACKUP/RESTORE command with shortened paths and names; confirm it completes successfully without raising Error 3260 in the SQL Server Error Log (Management > SQL Server Logs in SSMS).
  • If the error persists, enable Trace Flag 3014 (verbose backup logging) temporarily via DBCC TRACEON (3014, -1); to capture more granular diagnostic output and identify the exact string causing the buffer overflow.

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

Troubleshooting Guide: Error 3259 – “Failed to copy blob with name ‘%ls'”

Why This Error Happens

Error 3259 typically occurs during a SQL Server BACKUP or RESTORE operation targeting a URL (Azure Blob Storage) when the backup process cannot successfully write or read the blob file. This is most commonly caused by invalid or expired Shared Access Signature (SAS) credentials, network interruptions between the SQL Server instance and the storage endpoint, or insufficient permissions on the storage container. Corrupted credential objects within SQL Server or a mismatch in the blob storage access tier can also trigger this failure.

Step-by-Step Resolution Guide

Step 1: Verify the SQL Server Credential and SAS Token

  • Open SQL Server Management Studio (SSMS) and run SELECT * FROM sys.credentials; to confirm the credential tied to your storage account URL exists.
  • Check the expiration date of the SAS token used to create the credential; expired tokens are the leading cause of Error 3259.
  • If expired, generate a new SAS token from the Azure Portal under Storage Account > Shared Access Signature, then recreate the credential:
CREATE CREDENTIAL [https://<account>.blob.core.windows.net/<container>]
WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
SECRET = '<new_sas_token>';

Step 2: Test Network Connectivity to the Storage Endpoint

  • On Windows Server 2025 or Windows 11, open PowerShell and run Test-NetConnection <account>.blob.core.windows.net -Port 443 to confirm outbound HTTPS access.
  • Check Windows Firewall rules under Control Panel > Windows Defender Firewall > Advanced Settings to ensure outbound traffic on port 443 is not blocked.
  • If using a proxy, verify the SQL Server service account has proxy credentials configured in machine.config or via system-wide proxy settings.

Step 3: Validate Blob Container Permissions and Access Tier

  • In the Azure Portal, navigate to Storage Account > Containers and confirm the target container exists and is not set to “Archive” tier (archived blobs cannot be written to directly).
  • Confirm the SAS token permissions include Read, Write, List, and Create at minimum.
  • Regenerate the SAS token with correct permissions if any are missing, then update the SQL Server credential as shown in Step 1.

Step 4: Restart SQL Server Services and Retry the Operation

  • Open Services.msc on Windows Server 2025, locate “SQL Server (MSSQLSERVER)”, and restart the service to clear any cached connection states.
  • Re-run the BACKUP or RESTORE command:
BACKUP DATABASE [YourDB]
TO URL = 'https://<account>.blob.core.windows.net/<container>/YourDB.bak'
WITH CREDENTIAL = '<credential_name>', STATS = 10;
  • Monitor the SQL Server Error Log (SSMS > Management > SQL Server Logs) for confirmation of successful completion.

Alternative or Verification Steps

  • Verify success by checking the Azure Storage container directly via Azure Storage Explorer to confirm the blob file was created with the expected size and timestamp.
  • If the issue persists, switch to a Managed Identity or Storage Account Key authentication method instead of SAS tokens, as token-based credentials are more prone to silent expiration issues.

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

Troubleshooting Guide: SQL Server Error 3257 – Insufficient Disk Space to Create Database

Why This Error Happens

Error 3257 occurs when SQL Server attempts to allocate space for a new database (or auto-grow an existing one) but the target disk volume does not have enough contiguous free bytes to satisfy the request. This is commonly caused by the data/log drive filling up due to unchecked database growth, large pre-sized file requests exceeding actual disk capacity, or other applications/snapshots consuming space on the same volume. It can also occur if the database file was configured with an unrealistic initial size or growth setting that exceeds the physical limits of the underlying storage.

Step-by-Step Resolution Guide

Step 1: Confirm Actual Free Space on the Target Volume

  • Open File Explorer or run Get-PSDrive -PSProvider FileSystem in PowerShell to check free space on the volume referenced in the error (e.g., C:, D:, or a mount point).
  • Cross-check against SQL Server’s reported required bytes (%I64u) in the error message to confirm the shortfall.
  • Check for hidden space consumers like VSS shadow copies: vssadmin list shadowstorage.

Step 2: Free Up or Reclaim Disk Space

  • Delete or archive old .bak, .trn, or .log files from the SQL Server backup directory (commonly C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\).
  • Shrink unnecessarily large transaction logs using DBCC SHRINKFILE (N'LogicalLogFileName', TargetSizeMB); — only as a temporary fix, not routine practice.
  • Clear Windows temp files and empty the Recycle Bin on the server using Disk Cleanup (cleanmgr.exe) or Remove-Item scripts.
  • Remove outdated Windows Server 2025 update caches via Dism.exe /Online /Cleanup-Image /StartComponentCleanup.

Step 3: Redirect or Expand Storage

  • If space cannot be freed, move the database files to a volume with more capacity using ALTER DATABASE [DBName] MODIFY FILE (NAME = LogicalFileName, FILENAME = 'E:\SQLData\NewPath.mdf'); followed by taking the DB offline, moving the physical file, then bringing it back online.
  • Alternatively, expand the virtual disk (VHDX) in Hyper-V or extend the volume via Disk Management (diskmgmt.msc) if using a VM or cloud-based instance (Azure/AWS).
  • For physical servers, add additional storage hardware or reallocate an existing unused partition using Extend Volume in Disk Management.

Step 4: Adjust Database Growth Settings

  • Open SQL Server Management Studio (SSMS) → Right-click the database → Properties → Files.
  • Set realistic Autogrowth/Maxsize values (e.g., growth by fixed MB chunks like 256MB instead of percentage-based growth) to prevent future allocation requests that exceed available disk space.
  • Enable Instant File Initialization (via Local Security Policy → Perform volume maintenance tasks granted to the SQL Server service account) to speed up growth operations and reduce allocation stalls.

Alternative or Verification Steps

  • After freeing space or expanding storage, retry the database creation command (CREATE DATABASE [DBName]) or the operation that originally failed, and confirm it completes without Error 3257.
  • Run sp_spaceused or check Disk Usage Reports in SSMS to verify the database now has adequate space and monitor the Windows Performance Monitor counter LogicalDisk\Free Space to catch future shortages proactively.

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

Troubleshooting Guide: SQL Server Error 3258 — Media Set Mismatch

Why This Error Happens

Error 3258 occurs when SQL Server reads the media header on a backup device and finds that the media family GUID or sequence number does not match the media set it expects for the current restore or append operation. This typically happens when a tape or disk file from a different backup set, a different media family, or an out-of-sequence volume in a multi-file striped backup is loaded into the device. It can also occur if a backup file was renamed, overwritten, or partially copied, corrupting the media header information SQL Server relies on to validate set membership.

Step-by-Step Resolution Guide

Step 1: Identify the Correct Media Set and Family

  • Run RESTORE HEADERONLY FROM DISK = 'C:\Backups\YourFile.bak' to inspect the MediaSetId and FamilyGuid of the file you’re loading.
  • Compare this against the original backup job’s media set, especially if backups are striped across multiple files or tapes.
  • Confirm you are not mixing files from two separate BACKUP DATABASE operations that targeted the same device name but different media sets.

Step 2: Verify Device Order in Striped Backups

  • If the backup spans multiple files (e.g., Backup_1.bak, Backup_2.bak, Backup_3.bak), ensure all files are referenced together in the same RESTORE or BACKUP statement in the correct order:
  • RESTORE DATABASE YourDB FROM DISK = 'C:\Backups\Backup_1.bak', DISK = 'C:\Backups\Backup_2.bak', DISK = 'C:\Backups\Backup_3.bak'
  • Do not attempt to restore a single file from a striped set in isolation — this is a common cause of the 3258 mismatch.
  • Check the backup job history in SQL Server Agent or your backup software to confirm the exact file list and sequence used during the original backup.

Step 3: Check for File Corruption or Incorrect Overwrites

  • Use RESTORE VERIFYONLY FROM DISK = 'C:\Backups\YourFile.bak' to confirm the file is readable and not corrupted.
  • Check if WITH FORMAT or WITH INIT was accidentally used on an existing media set, which can overwrite the header and break set continuity.
  • Inspect the file’s last-modified timestamp and size against your backup job logs to rule out a partial copy or interrupted file transfer (especially over network shares or cloud storage sync tools).

Step 4: Re-Run the Backup If the Set Is Unrecoverable

  • If the media header is confirmed corrupted or files are missing from the set, the existing backup set cannot be repaired — you must generate a new full backup.
  • Run a fresh BACKUP DATABASE YourDB TO DISK = 'C:\Backups\NewFullBackup.bak' WITH INIT, CHECKSUM.
  • Store all related backup files together going forward and avoid renaming files independently once a media set is created.

Alternative or Verification Steps

  • After gathering the correct files in sequence, re-attempt the restore using RESTORE DATABASE ... WITH FILE = <n> to confirm the specific backup set number is recognized without error.
  • If using a third-party backup tool (e.g., Veeam, NetBackup), check its catalog/index for the specific media set GUID rather than relying solely on file names, since tools sometimes repurpose identical file names across different backup sets.

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

Troubleshooting Guide: Error 3256 — Backup Set Terminated and Incomplete

Why This Error Happens

This error occurs when SQL Server 2025 detects that the backup file (.bak) on the specified device is truncated, corrupted, or was not fully written to disk, often because the backup operation was interrupted mid-process by a network drop, disk I/O failure, or manual cancellation. It can also occur if antivirus software or a backup agent locks or modifies the file while SQL Server is still writing to it. Additionally, insufficient disk space on the target volume during the backup operation can cause the write to fail silently, leaving an incomplete backup set that later fails validation during a RESTORE sequence.

Step-by-Step Resolution Guide

Step 1: Verify the Integrity of the Backup File

  • Check the file size of the .bak file on disk and compare it against the expected size from the original backup job history (visible in msdb.dbo.backupset).
  • Run RESTORE VERIFYONLY FROM DISK = 'C:\Backups\YourFile.bak' in SQL Server Management Studio (SSMS) to confirm whether the file is readable.
  • If the command returns Error 3256 or 3241, the file is confirmed incomplete and cannot be used for restoration.

Step 2: Rule Out Storage and Network Interruptions

  • Check the Windows Server 2025 Event Viewer under Windows Logs > System for disk-related warnings (Event ID 153 or 157) around the timestamp of the backup job.
  • If backing up to a network share (UNC path), confirm the SQL Server service account has stable, uninterrupted connectivity — test with Test-NetConnection -ComputerName <ServerName> -Port 445 in PowerShell.
  • Ensure the destination drive had sufficient free space at the time of backup; check via Get-PSDrive or File Explorer properties.

Step 3: Exclude Antivirus and Backup Agent Interference

  • Open Windows Security (or your third-party antivirus console) and add an exclusion for the SQL Server data and backup directories, typically located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\.
  • Disable any third-party backup agents (e.g., Veeam, Commvault) that may be running concurrent I/O operations on the same .bak file.
  • Restart the SQL Server service via services.msc or Restart-Service MSSQLSERVER after applying exclusions.

Step 4: Re-run the Backup Using WITH CHECKSUM

  • Execute a fresh, full backup using the WITH CHECKSUM option to enable page-level validation during the write process:
  • BACKUP DATABASE [YourDB] TO DISK = 'C:\Backups\YourFile_New.bak' WITH CHECKSUM, INIT;
  • This ensures any future corruption is caught immediately at backup time rather than during a later restore attempt.

Step 5: Restore From a Known-Good Backup Set

  • If the corrupted file cannot be salvaged, locate the most recent valid full backup and subsequent transaction log backups from your backup history table (msdb.dbo.backupset).
  • Run the RESTORE sequence again starting from the last verified good full backup: RESTORE DATABASE [YourDB] FROM DISK = 'C:\Backups\LastGood.bak' WITH NORECOVERY;
  • Apply any subsequent log backups in order, finishing with WITH RECOVERY on the final file.

Alternative or Verification Steps

  • To verify the fix, run RESTORE VERIFYONLY FROM DISK = 'C:\Backups\YourFile_New.bak' — a successful message with no errors confirms the backup set is now valid and complete.
  • If the issue persists across multiple backup attempts, run CHECKDB (DBCC CHECKDB('YourDB') WITH NO_INFOMSGS) on the source database to rule out underlying data corruption as the root cause, and consider moving the backup destination to a different physical disk or storage array.

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

Troubleshooting Guide: Error 3255 – Backup Set Not Compatible with This Version of SQL Server

Why This Error Happens

This error occurs when SQL Server attempts to restore a .bak file that was created on a newer version of SQL Server than the instance performing the restore, as backup formats are not backward-compatible across major versions. It can also occur if the backup file has become corrupted during transfer (e.g., FTP in ASCII mode instead of binary) or if the media header is damaged, causing SQL Server to misread the internal version stamp. Less commonly, this happens when attempting to restore a backup set onto a Standard or Express edition that doesn’t support features used in the original Enterprise-edition backup.

Step-by-Step Resolution Guide

Step 1: Verify the Source and Target SQL Server Versions

  • Run SELECT @@VERSION; on the source server (where the backup was created) and the target server (where you are restoring).
  • Confirm the target server version number is equal to or higher than the source. SQL Server 2025 backups cannot be restored to SQL Server 2022, 2019, or earlier.
  • Check the build number via SELECT SERVERPROPERTY('ProductVersion'); for precise version matching.

Step 2: Inspect the Backup File Header for Corruption

  • Open SQL Server Management Studio (SSMS) and run the following to check header integrity without performing a full restore:
RESTORE HEADERONLY FROM DISK = 'C:\Backups\YourFile.bak';
  • Review the SoftwareVersionMajor and SoftwareVersionMinor columns in the result set to confirm the actual originating version.
  • If the command fails outright or returns garbled data, the file is likely corrupted and not just a version mismatch—re-transfer the file using binary mode if it was moved via FTP/SCP.

Step 3: Re-acquire or Re-transfer the Backup File

  • If the backup was copied over a network share or cloud storage (e.g., Azure Blob, OneDrive), re-download the file and verify the file size in bytes matches the source exactly.
  • On Windows Server 2025, use Get-FileHash C:\Backups\YourFile.bak -Algorithm SHA256 on both source and destination machines to confirm checksums match, ruling out transfer corruption.
  • If the file is confirmed corrupted and no clean copy exists, check for a .trn log chain or a secondary backup in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\ as a fallback.

Step 4: Upgrade or Provision a Matching SQL Server Instance

  • If the target genuinely has an older engine version, install a SQL Server 2025 instance (or the matching minor build) via the Installation Center on Windows Server 2025.
  • Alternatively, spin up a temporary SQL Server 2025 Developer Edition instance to restore the backup, extract the data via BCP or Generate Scripts, and migrate it into the older target environment manually.

Alternative or Verification Steps

  • After restoring successfully, run DBCC CHECKDB('YourDatabaseName'); to confirm database consistency and rule out latent corruption.
  • As a quick alternative, use RESTORE VERIFYONLY FROM DISK = 'C:\Backups\YourFile.bak'; before attempting a full restore—this quickly validates backup integrity and compatibility without committing to a full restore operation.

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

Troubleshooting Guide: SQL Server Error 3254 — “The volume on device ‘%ls’ is empty”

Why This Error Happens

This error typically occurs during a BACKUP or RESTORE operation when SQL Server expects a valid backup media header on the target device but finds an empty or uninitialized volume instead. The root cause is usually a backup file that was created with zero bytes (due to a failed prior backup job, disk space exhaustion, or antivirus/backup software interference), a newly provisioned disk or tape that was never formatted or initialized with a media header, or file corruption resulting from an interrupted I/O operation. In some cases, this also happens when the backup device path points to a network share or volume that disconnected mid-write, leaving a placeholder file with no actual data.

Step-by-Step Resolution Guide

Step 1: Verify the Backup Device and File Integrity

  • Navigate to the backup destination path (e.g., D:\SQLBackups\ or the mapped network share) and check the file size of the .bak or .trn file in question.
  • If the file size is 0 KB, this confirms the backup never wrote a valid header — the file is unusable and must be discarded.
  • Run RESTORE VERIFYONLY FROM DISK = 'D:\SQLBackups\YourFile.bak' in SSMS to confirm whether SQL Server can read the media header at all.

Step 2: Check Disk Space and Storage Health

  • Open Disk Management (diskmgmt.msc) on Windows Server 2025 and confirm the target volume has sufficient free space; backups silently fail or truncate when a disk runs out of space mid-write.
  • Use chkdsk D: /f /r (replace D: with your backup volume) to scan for and repair underlying file system corruption.
  • If using a SAN, NAS, or network share, confirm the connection didn’t drop during the backup window by reviewing Windows Event Viewer under System logs for disk or network timeout errors (Event ID 153 or 140).

Step 3: Re-initialize or Recreate the Backup Device

  • If the device is a dedicated backup file (not tape), delete the corrupted zero-byte file and recreate the backup job using BACKUP DATABASE [YourDB] TO DISK = 'D:\SQLBackups\YourFile_new.bak' WITH INIT, STATS = 10.
  • For tape devices, ensure the tape is properly formatted and not write-protected; reseat the tape or run the vendor’s media initialization utility.
  • If using a backup device object (sys.backup_devices), drop and recreate it using EXEC sp_dropdevice 'DeviceName' followed by EXEC sp_addumpdevice 'disk', 'DeviceName', 'D:\SQLBackups\YourFile.bak'.

Step 4: Review Permissions and Antivirus Interference

  • Confirm the SQL Server service account has Modify permissions on the backup folder (right-click folder → Properties → Security tab).
  • Temporarily exclude the backup directory from real-time antivirus scanning, as some AV products lock or quarantine files mid-write, resulting in empty volumes.
  • Restart the SQL Server service (services.msc → SQL Server (MSSQLSERVER) → Restart) after making permission changes to clear any stale file handles.

Alternative or Verification Steps

  • Run a fresh test backup immediately after applying fixes: BACKUP DATABASE [TestDB] TO DISK = 'D:\SQLBackups\TestVerify.bak' WITH INIT and confirm the resulting file size is greater than 0 KB before relying on it for production restores.
  • If the issue persists on the same physical volume, provision a new disk or share, point the backup job to the new location, and monitor the next 2–3 scheduled backup cycles to rule out recurring storage-level corruption.

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

Troubleshooting Guide: SQL Server Error 3252 – “Failed to copy snapshot with name ‘%ls'”

Why This Error Happens

This error typically occurs during a database snapshot operation when SQL Server 2025 cannot access, read, or write to the sparse file associated with the snapshot on the underlying NTFS volume. The root cause is usually insufficient NTFS permissions for the SQL Server service account on the snapshot directory, a corrupted or locked sparse file, or a lack of available disk space on the volume hosting the snapshot. In some cases, this is also triggered by antivirus software locking the file during the copy-on-write operation.

Step-by-Step Resolution Guide

Step 1: Verify NTFS Permissions and Service Account Access

  • Navigate to the directory specified in the snapshot creation script (e.g., D:\SQLSnapshots\).
  • Right-click the folder, select Properties > Security, and ensure the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Full Control.
  • Run icacls "D:\SQLSnapshots" /grant "NT SERVICE\MSSQLSERVER":(OI)(CI)F in an elevated Command Prompt to force the permission update.

Step 2: Check Disk Space and Volume Health

  • Open File Explorer and confirm the target volume has sufficient free space (snapshots require space equal to the modified pages of the source DB).
  • Run chkdsk D: /f via an elevated PowerShell terminal to repair any underlying file system corruption on the volume.
  • Restart the SQL Server (MSSQLSERVER) service via services.msc after the check completes.

Step 3: Exclude Snapshot Directories from Antivirus Scanning

  • Open Windows Security > Virus & threat protection > Manage settings.
  • Add an exclusion for the SQL Data root directory and the specific snapshot folder path to prevent file locking during the copy-on-write process.
  • Retry the CREATE DATABASE ... AS SNAPSHOT OF command once the exclusion is saved.

Step 4: Drop and Recreate the Corrupted Snapshot

  • If the specific snapshot file is already corrupted, run DROP DATABASE [Snapshot_Name]; in SQL Server Management Studio (SSMS) to clear the broken sparse file.
  • Execute the CREATE DATABASE snapshot command again, ensuring the file path does not contain restricted characters or exceed the Windows MAX_PATH limit.

Alternative or Verification Steps

  • Verify the Fix: Check the SQL Server Error Log (via EXEC sp_readerrorlog) to confirm no further 3252 errors appear after attempting a new snapshot creation.
  • Alternative Solution: If the error persists on a specific volume, attempt to create the snapshot on a different local disk volume to rule out a hardware-specific or driver-level block issue with the original disk.

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

Troubleshooting Guide: SQL Server Error 3253 — “The block size parameter must supply a value that is a power of 2”

Why This Error Happens

This error occurs when a BACKUP or RESTORE statement includes a BLOCKSIZE option with a value that is not a valid power of 2 (e.g., 512, 1024, 2048, 4096, 8192, 16384, 32768, or 65536). This typically happens due to a manually scripted T-SQL command containing a typo, a misconfigured backup tool or third-party agent passing an incorrect numeric string, or legacy maintenance plan scripts that were never updated for modern tape/disk device requirements. Since SQL Server 2025 strictly validates this parameter before allocating buffer memory for the I/O operation, any non-conforming integer immediately aborts the backup or restore job.

Step-by-Step Resolution Guide

Step 1: Locate the Offending T-SQL Script

  • Open SQL Server Management Studio (SSMS) and review the Job History in SQL Server Agent (under SQL Server Agent > Jobs > View History) to find the exact script that triggered Error 3253.
  • Search the script specifically for the BLOCKSIZE = clause within the BACKUP DATABASE or RESTORE DATABASE syntax.
  • Check for common injection points, such as dynamic SQL variables (@BlockSize) that may be pulling malformed configuration data from a table or an external PowerShell script.

Step 2: Correct the BLOCKSIZE Parameter Value

  • Edit the script to replace the invalid value with a supported power of 2. For most disk-based backups, the standard value is 65536 (64KB).
  • Example of a corrected syntax:
  BACKUP DATABASE [YourDatabaseName] 
  TO DISK = N'C:\Backups\YourDatabaseName.bak' 
  WITH BLOCKSIZE = 65536, NOFORMAT, NOINIT;
  • If using a third-party backup tool (e.g., Veeam, Dell NetVault) integrated with SQL Server 2025, open the tool’s configuration panel and verify the “Block Size” field is set to a dropdown-selected standard value rather than a free-text manual entry.

Step 3: Audit Maintenance Plans and SSIS Packages

  • Open SQL Server Management Studio and navigate to Management > Maintenance Plans.
  • Double-click on the specific “Back Up Database Task” and check the Set backup compression and advanced options tabs for a hard-coded block size value.
  • If found in an SSIS package, open the package in Visual Studio/SSDT, locate the “Execute SQL Task,” and correct the parameter in the connection manager properties.

Step 4: Clear Cached Execution Plans (If using Dynamic SQL)

  • If the value was pulled from a variable that has since been corrected, clear the procedure cache to ensure the old execution plan (containing the invalid parameter) is not reused.
  • Run the following command in a query window connected to the specific instance:
  DBCC FREEPROCCACHE;

Alternative or Verification Steps

  • Verify the Fix: Re-run the specific backup or restore job manually via SSMS. If the job completes without throwing Error 3253 and the .bak file size increases on the disk, the parameter correction was successful.
  • Alternative Solution: If you are unsure of the ideal value for your specific Windows Server 2025 disk array, omit the BLOCKSIZE parameter entirely from the script. SQL Server 2025 will automatically negotiate and select the optimal default block size based on the destination media (disk vs. tape).

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

Troubleshooting Guide: SQL Server Error 3251 – “Media Family on Device is Complete”

Why This Error Happens

Error 3251 is actually an informational message, not a true failure—it indicates that SQL Server has finished reading or writing one file in a multi-file backup set and is now moving to the next media family on the same device. This typically occurs during backup or restore operations that span multiple backup devices (striped backups) or when a single device file reaches its logical end. In most cases, this message appears alongside more serious errors (like 3013 or 3203) when a corrupted backup file, a missing stripe member, or an incorrectly sequenced RESTORE command causes SQL Server to misinterpret the media family boundaries.

Step-by-Step Resolution Guide

Step 1: Confirm Whether This Is a True Error or Informational Notice

  • Check the SQL Server Error Log (Management Studio > Management > SQL Server Logs) to see if Error 3251 is followed by a successful completion message or by a hard failure (e.g., Error 3013: “BACKUP/RESTORE is terminating abnormally”).
  • Run xp_readerrorlog via T-SQL to pull the exact sequence of events:
  EXEC xp_readerrorlog 0, 1, N'3251';
  • If the backup/restore job completes successfully afterward, no action is needed—this is expected behavior for multi-file media sets.

Step 2: Verify All Backup Files in the Media Set Are Present and Accessible

  • If you’re restoring a striped backup (multiple .bak files), ensure all files are listed in the RESTORE DATABASE command in the correct order:
  RESTORE DATABASE [YourDB]
  FROM DISK = 'D:\Backups\YourDB_1.bak',
       DISK = 'D:\Backups\YourDB_2.bak',
       DISK = 'D:\Backups\YourDB_3.bak'
  WITH RECOVERY;
  • Confirm file paths exist and are reachable from the SQL Server service account (check NTFS permissions on D:\Backups\).
  • Use RESTORE VERIFYONLY first to validate the backup set integrity before running the full restore.

Step 3: Check for Backup Device Corruption or Premature Media Family Termination

  • Run a checksum validation on the backup files:
  RESTORE VERIFYONLY FROM DISK = 'D:\Backups\YourDB_1.bak' WITH CHECKSUM;
  • If corruption is detected, re-run the original backup job using WITH CHECKSUM enabled to catch future issues early.
  • Inspect Windows Server 2025 Event Viewer (Windows Logs > Application) for disk I/O errors (Event ID 7 or 51) that may indicate underlying storage issues affecting the backup device.

Step 4: Update SQL Server 2025 Cumulative Updates

  • Navigate to Microsoft Update Catalog or use SQL Server Configuration Manager to confirm your current build.
  • Apply the latest Cumulative Update (CU) for SQL Server 2025, as early releases on Windows Server 2025 have known media-handling bugs related to multi-device backup sequencing.
  • Restart the SQL Server service after patching:
  Restart-Service -Name 'MSSQLSERVER'

Alternative or Verification Steps

  • Verify the fix: Re-run the full backup/restore operation and confirm it completes with only informational Error 3251 entries (no accompanying 3013 or 3203 errors) in the SQL Server log.
  • Alternative solution: If striped backups continue causing issues, switch to a single-file backup target or use BACKUP ... TO URL with Azure Blob Storage to eliminate multi-device media family complexity entirely.

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

Troubleshooting Guide: SQL Server Error 3250 – “The value ‘%d’ is not within range for the %ls parameter”

Why This Error Happens

This error typically occurs during backup or restore operations when a specified parameter value—such as BLOCKSIZE, BUFFERCOUNT, MAXTRANSFERSIZE, or a file/device number—falls outside the acceptable range defined by the SQL Server Database Engine. It commonly arises from manually scripted T-SQL backup/restore commands where a value was mistyped, copied from an incompatible script, or inherited from a legacy SQL Server version with different parameter boundaries. In some cases, corrupted backup media headers or mismatched media family counts can also trigger this validation failure.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Parameter and Value

  • Review the full error message text to extract the exact parameter name (%ls) and value (%d) that triggered the failure.
  • Check the SQL Server Error Log via C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for the full context of the failed statement.
  • Locate the T-SQL script (BACKUP, RESTORE, or WITH options) that was executed immediately before the error appeared.

Step 2: Validate Parameter Ranges Against SQL Server 2025 Documentation

  • Confirm BUFFERCOUNT is a positive integer and not set unreasonably high relative to available memory (excessive values can exceed internal limits).
  • Verify MAXTRANSFERSIZE is set in valid increments (65536 up to 4194304 bytes) and is a multiple of 65536.
  • Check BLOCKSIZE values against supported device block sizes (typically 512 to 65536 bytes).
  • If using FILE = or MEDIANAME = options, ensure referenced file/media numbers correspond to an existing, correctly ordered backup set.

Step 3: Correct and Re-run the T-SQL Statement

  • Edit the script in SQL Server Management Studio (SSMS) to correct the invalid parameter value.
  • Example correction:
  BACKUP DATABASE [YourDB]
  TO DISK = 'D:\Backups\YourDB.bak'
  WITH BUFFERCOUNT = 50, MAXTRANSFERSIZE = 1048576;
  • Execute the corrected script and monitor for successful completion in the Messages tab.

Step 4: Check for Corrupted or Incompatible Backup Media

  • Run RESTORE VERIFYONLY FROM DISK = 'D:\Backups\YourDB.bak'; to confirm the backup file integrity before attempting a full restore.
  • If verification fails, regenerate the backup file from a known-good source or a different backup set.

Step 5: Review Maintenance Plans and Automation Scripts

  • Open SQL Server Agent Jobs in SSMS and inspect any scheduled backup/restore jobs for hardcoded parameter values.
  • Update any PowerShell or dbatools scripts (e.g., Backup-DbaDatabase) that may be passing out-of-range values programmatically.

Alternative or Verification Steps

  • Re-run the corrected backup/restore command and confirm it completes with “processed successfully” messages and no Error 3250 in the ERRORLOG.
  • If the issue persists, strip the command down to default parameters (no BUFFERCOUNT, BLOCKSIZE, or MAXTRANSFERSIZE) to isolate whether a specific option is still causing the range violation.

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

Troubleshooting Guide: SQL Server Error 3249

Why This Error Happens

This error occurs when SQL Server detects that the media presented for a restore operation is not the first volume in a multi-volume backup set. It typically happens when backup files from a striped or multi-file backup set are provided out of sequence, or when a backup file is mistakenly treated as a standalone file when it is actually a continuation volume. Corrupted media headers or incorrectly concatenated backup files can also trigger this error, as SQL Server reads volume sequence metadata embedded in the backup header to validate order.

Step-by-Step Resolution Guide

Step 1: Identify All Volumes in the Backup Set

  • Locate every file or tape associated with the original backup operation (e.g., BackupFile1.bak, BackupFile2.bak, BackupFile3.bak).
  • Check the original backup script or job history in SQL Server Agent to confirm how many files/devices were used in the BACKUP DATABASE statement.
  • Use RESTORE LABELONLY FROM DISK = 'C:\Backups\BackupFile1.bak' to inspect media labels and sequence numbers.

Step 2: Reconstruct the Correct Restore Command

  • Ensure the restore statement lists all volumes in the exact order they were created, starting with the first volume.
  • Example syntax:
RESTORE DATABASE [YourDB]
FROM DISK = 'C:\Backups\BackupFile1.bak',
     DISK = 'C:\Backups\BackupFile2.bak',
     DISK = 'C:\Backups\BackupFile3.bak'
WITH RECOVERY;
  • Do not attempt to restore using only the second or third file in the set — SQL Server requires the starting volume to initialize the restore header.

Step 3: Validate File Integrity and Permissions

  • Confirm the SQL Server service account has read access to the folder, typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\.
  • Check that none of the .bak files were truncated, renamed, or corrupted during transfer (e.g., FTP in ASCII mode instead of Binary mode).
  • Run RESTORE VERIFYONLY FROM DISK = 'C:\Backups\BackupFile1.bak' to confirm the first volume is valid and readable.

Step 4: Re-run the Backup if Files Are Unrecoverable

  • If the first volume is missing or corrupted beyond repair, the entire multi-volume set is unusable for restore.
  • Schedule a fresh full backup using BACKUP DATABASE with a single destination file (or properly labeled multiple files) to avoid future sequencing issues.

Alternative or Verification Steps

  • After restoring, run DBCC CHECKDB on the restored database to confirm consistency and that no data was lost during the fix.
  • If multiple volumes continue to cause ordering issues, consider switching future backups to a single backup file destination (or use a backup compression tool with built-in catalog tracking) to eliminate volume-sequence errors entirely.

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

Troubleshooting Guide: SQL Server Error 3246 — Media Family Marked as Nonappendable

Why This Error Happens

This error occurs when SQL Server 2025 attempts to append a new backup to a backup device or file whose media header indicates that it does not allow appending (nonappendable media). This typically happens when the backup media was originally created with the NOINIT or default appendable settings disabled, or when a third-party backup tool or SQL Server itself wrote a backup set with restricted permissions on the media family. It can also occur if the backup file was created fresh with the FORMAT option, which locks subsequent appends unless explicitly overridden.

Step-by-Step Resolution Guide

Step 1: Identify the Backup Device and Current Media State

  • Open SQL Server Management Studio (SSMS) or run a T-SQL query against the target backup file/device.
  • Execute RESTORE LABELONLY FROM DISK = 'C:\Backups\YourFile.bak' to inspect the media family properties.
  • Confirm whether the Is Appendable flag is set to 0, which confirms the nonappendable state.

Step 2: Reissue the Backup Statement with the INIT Option

  • Modify your BACKUP DATABASE or BACKUP LOG statement to explicitly include WITH INIT.
  • Example command:
  BACKUP DATABASE [YourDatabase] 
  TO DISK = 'C:\Backups\YourFile.bak' 
  WITH INIT, NOFORMAT;
  • Note that INIT overwrites existing backup sets on the media but preserves the media header, whereas FORMAT destroys the entire header.

Step 3: Check File and Folder Permissions on Windows Server 2025

  • Navigate to the backup destination folder (e.g., C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\).
  • Right-click the folder, select Properties > Security, and verify the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Modify and Write permissions.
  • Restart the SQL Server service via services.msc if permissions were changed.

Step 4: Create a New Backup Device if the Issue Persists

  • If the existing media remains locked or corrupted, create a fresh backup device using SSMS under Server Objects > Backup Devices, or run:
  EXEC sp_addumpdevice 'disk', 'NewBackupDevice', 'C:\Backups\NewFile.bak';
  • Point your backup job or maintenance plan to this new device going forward.

Alternative or Verification Steps

  • Run RESTORE VERIFYONLY FROM DISK = 'C:\Backups\YourFile.bak' after applying the fix to confirm the backup file is now readable and valid.
  • If INIT does not resolve the issue, use WITH FORMAT instead to completely reinitialize the media (note: this permanently erases all existing backup sets on that device, so ensure other recovery points exist first).

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

Troubleshooting Guide: SQL Server Error 3247 – Wrong Media Sequence Number

Why This Error Happens

Error 3247 occurs when SQL Server 2025 is performing a restore operation from a multi-volume backup set and detects that the media volume currently loaded does not match the expected sequence number in the backup header. This typically happens when backup tapes, files, or disk volumes belonging to a striped or multi-file backup set are presented to the RESTORE command out of order. It can also occur if a backup file was manually renamed, partially copied, or corrupted, causing SQL Server’s media management subsystem to misread the volume’s internal sequence metadata.

Step-by-Step Resolution Guide

Step 1: Identify the Correct Volume Order

  • Run RESTORE LABELONLY FROM DISK = 'path_to_backup' or RESTORE HEADERONLY against each file in the backup set to inspect the MediaSequenceNumber and FamilySequenceNumber columns.
  • Record the correct numerical order of each .bak or .trn file as indicated by SQL Server metadata, not by filename or timestamp.
  • On Windows Server 2025/Windows 11, ensure all volume files are accessible from the same local path or UNC share (e.g., \\BackupServer\SQLBackups\).

Step 2: Reissue the RESTORE Command in Correct Sequence

  • Use the RESTORE DATABASE ... FROM DISK = N'Volume1', DISK = N'Volume2' syntax, explicitly listing files in the sequence number order identified in Step 1.
  • If using a media/tape library, physically reload the volumes in the exact order requested by the error message prompt (e.g., “insert volume 2”).
  • Example T-SQL:
RESTORE DATABASE [YourDB] 
FROM DISK = N'C:\Backups\Backup_Vol1.bak', 
     DISK = N'C:\Backups\Backup_Vol2.bak'
WITH FILE = 1, NORECOVERY;

Step 3: Validate Backup File Integrity

  • Run RESTORE VERIFYONLY FROM DISK = 'path_to_backup' on each volume to confirm the file is not corrupted or truncated.
  • Check file properties in Windows File Explorer or via PowerShell (Get-Item <path> | Select Length) to ensure no volume was partially copied during a file transfer.
  • If a volume is missing or corrupted, re-copy it from the original source media or backup repository.

Step 4: Rebuild the Backup Set Reference (If Using a Media Set)

  • If the backup was created with WITH MEDIANAME or as part of a named media set, confirm the MEDIANAME and MEDIAPASSWORD (if applicable) match across all volumes using RESTORE HEADERONLY.
  • Avoid mixing volumes from different backup operations into a single RESTORE statement, as this causes sequence mismatches even if filenames appear similar.

Alternative or Verification Steps

  • After a successful restore, verify database consistency by running DBCC CHECKDB('YourDB') WITH NO_INFOMSGS to confirm no corruption was introduced during the restore process.
  • If the correct sequence still fails, take a fresh full backup of the source database (if accessible) using BACKUP DATABASE ... TO DISK with a single destination file to eliminate multi-volume sequencing issues entirely.

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

Troubleshooting Guide: SQL Server Error 3245 – “Could Not Convert a String to or from Unicode”

Why This Error Happens

Error 3245 typically occurs during database backup or restore operations when SQL Server encounters a corrupted media header or an incompatible code page while attempting to translate string data between Unicode and non-Unicode formats. This is often caused by a damaged backup file, an incomplete file transfer (especially across different OS locales), or a mismatch between the collation settings of the source and destination servers. In some cases, the backup media itself may have been truncated or corrupted during storage or network transfer.

Step-by-Step Resolution Guide

Step 1: Verify Backup File Integrity

  • Check the backup file size against the expected size from the source server to rule out truncation.
  • Run RESTORE VERIFYONLY FROM DISK = 'C:\Backups\YourFile.bak' in SQL Server Management Studio (SSMS) to test if the header is readable.
  • If the command fails immediately, the file is likely corrupted and will need to be re-generated from the source.

Step 2: Check Server and Database Collation Settings

  • Open SSMS and run SELECT SERVERPROPERTY('Collation'); on both the source and destination instances.
  • Ensure both Windows Server 2025 instances are using compatible Unicode collations (e.g., SQL_Latin1_General_CP1_CI_AS).
  • If a mismatch exists, use the COLLATE clause in your query or rebuild the database with the matching collation before restoring.

Step 3: Re-transfer the Backup Using Binary Mode

  • If the file was moved via FTP or a network share, ensure the transfer protocol used Binary mode rather than ASCII mode, as ASCII mode corrupts Unicode byte structures.
  • Navigate to the file location (e.g., D:\MSSQL\Backup\) and verify permissions allow the SQL Server service account full read/write access.
  • Re-copy the file using Robocopy with the /J (unbuffered I/O) flag to prevent Windows Server 2025 caching issues: robocopy C:\Source D:\Destination YourFile.bak /J.

Step 4: Update SQL Server 2025 Cumulative Updates

  • Navigate to the Microsoft Update Catalog and check if a specific Cumulative Update (CU) addresses Unicode conversion bugs for your build.
  • Apply the update via the SQL Server Installation Center, selecting Maintenance > Edition Upgrade/Patch.
  • Restart the SQL Server (MSSQLSERVER) service via services.msc after installation completes.

Alternative or Verification Steps

  • Verification: Attempt the RESTORE DATABASE command again after applying the fixes; success is confirmed if the database mounts and appears “Online” in SSMS Object Explorer without rollback errors.
  • Alternative: If the error persists, attempt to restore the backup on a different intermediary server with a default SQL_Latin1_General_CP1_CI_AS collation to isolate whether the issue is collation-specific or purely file corruption.

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

Troubleshooting Guide: SQL Server Error 3244 – Descriptor Block Size Exceeded

Why This Error Happens

This error occurs when a BACKUP or RESTORE operation includes a media set name, backup set name, or description string that exceeds the internal buffer limit allocated for the backup descriptor block. SQL Server 2025 reserves a fixed-size structure to store metadata labels (name, description, and expiration info) within the media header, and when combined string lengths push past this boundary, the engine rejects the operation rather than truncating data silently. This is commonly triggered by automated backup scripts that dynamically concatenate timestamps, server names, and long descriptive text into the NAME or DESCRIPTION parameters.

Step-by-Step Resolution Guide

Step 1: Identify the Offending T-SQL Statement

  • Locate the exact BACKUP or RESTORE command in your maintenance plan, SQL Agent job, or script that triggered Error 3244.
  • Check SQL Server Error Logs via C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for the exact timestamp and job correlation.
  • Review the NAME, DESCRIPTION, and MEDIANAME clauses for excessive length.

Step 2: Shorten the Name and Description Strings

  • Reduce the NAME parameter to under 128 characters and DESCRIPTION to under 255 characters as a safe practice.
  • Example corrected syntax:
  BACKUP DATABASE [YourDB] 
  TO DISK = N'D:\Backups\YourDB.bak' 
  WITH NAME = N'YourDB_Full', 
  DESCRIPTION = N'Nightly Full Backup';
  • Avoid dynamically appending full file paths, GUIDs, or verbose metadata into the description field.

Step 3: Update Automated Scripts and Maintenance Plans

  • Open SQL Server Management Studio (SSMS) and navigate to Management > Maintenance Plans.
  • Edit any Backup Task that uses dynamic string concatenation for naming conventions.
  • Replace verbose naming logic (e.g., @@SERVERNAME + DB_NAME() + GETDATE() + 'Full Backup of Production Database on Server...') with a standardized short-code naming convention.

Step 4: Validate Third-Party Backup Tool Configurations

  • If using tools like Veeam, Redgate, or Ola Hallengren’s Maintenance Solution, check the @BackupSoftware or naming template parameters in the stored procedure configuration.
  • Adjust the @CleanupTime or naming templates in CommandExecute procedures to shorten the generated string length.

Alternative or Verification Steps

  • Run the corrected BACKUP DATABASE command manually in SSMS to confirm Error 3244 no longer appears and the operation completes with the standard “percent processed” success messages.
  • If the error persists despite short strings, verify the MEDIANAME and MEDIADESCRIPTION parameters (if using a Media Set) separately, as these contribute to the same descriptor block size independently of the backup set name.

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

Troubleshooting Guide: SQL Server Error 3243 — Media Family Created Using Unsupported Tape Format Version

Why This Error Happens

This error occurs when SQL Server attempts to restore a backup file whose Microsoft Tape Format (MTF) version is newer or incompatible with the version supported by the current SQL Server instance. This commonly happens when a backup created on a newer SQL Server version (or a different backup utility) is restored onto an older or mismatched instance of SQL Server 2025. It can also result from a corrupted backup header or a backup file that was generated by a third-party backup tool using a non-standard MTF implementation.

Step-by-Step Resolution Guide

Step 1: Verify the Source and Target SQL Server Versions

  • Check the version of SQL Server that created the backup file by running RESTORE HEADERONLY FROM DISK = 'C:\Backups\YourFile.bak'.
  • Compare the SoftwareVersionMajor and SoftwareVersionMinor columns against your target SQL Server 2025 instance version (SELECT @@VERSION).
  • Confirm whether the backup was taken on a newer build or a pre-release/CTP version that uses a different MTF spec.

Step 2: Restore Using a Compatible SQL Server Instance

  • If the backup was created on a newer SQL Server version, install or use an instance of SQL Server that matches or exceeds that version to perform the restore.
  • On Windows Server 2025, open SQL Server Configuration Manager and confirm which instance/version is currently running.
  • If multiple instances exist, redirect your restore operation to the newer instance using SSMS or sqlcmd -S ServerName\InstanceName.

Step 3: Validate Backup File Integrity

  • Run RESTORE VERIFYONLY FROM DISK = 'C:\Backups\YourFile.bak' to confirm the file is not corrupted or truncated.
  • Check for incomplete file transfers (especially if the file was copied over SMB or FTP) by comparing file hash/checksum values on source and destination.
  • Re-copy the backup file using robust transfer tools like robocopy with the /Z (restartable mode) flag if corruption is suspected.

Step 4: Rule Out Third-Party Backup Software Conflicts

  • If the backup was created using a third-party agent (e.g., Veeam, Commvault, NetBackup), confirm that the tool’s SQL Server plug-in is updated to a version compatible with SQL Server 2025.
  • Check the vendor’s documentation for supported MTF versions before importing SQL-native restores into SSMS.
  • Reinstall or update the VSS writer for SQL Server if the backup chain was generated through Windows Server Backup or VSS-based snapshots.

Step 5: Rebuild or Re-Export the Backup File

  • If the original backup remains unusable, restore it on the SQL Server version it was created on, then perform a fresh native backup (BACKUP DATABASE... TO DISK) compatible with your target instance.
  • Transfer this newly generated .bak file to the SQL Server 2025 / Windows Server 2025 environment and retry the restore.

Alternative or Verification Steps

  • After applying fixes, re-run RESTORE DATABASE YourDB FROM DISK = 'C:\Backups\YourFile.bak' WITH CHECKSUM, STATS = 10; to confirm the restore completes without Error 3243.
  • If the issue persists, use RESTORE HEADERONLY output to manually cross-reference MTF version numbers against Microsoft’s official Tape Format documentation to confirm true compatibility before attempting further restores.

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

Why This Error Happens

Error 3241 typically occurs when SQL Server attempts to read a backup file (.bak or .trn) whose header or internal structure does not match what the Database Engine expects. This is most commonly caused by a corrupted or truncated backup file, a backup created by an incompatible or newer version of SQL Server, or the file being transferred between systems in ASCII/text mode instead of binary mode (which corrupts the byte structure). It can also occur if the backup device path is pointing to the wrong file, or if third-party backup compression/antivirus software interfered with the file during creation.

Step-by-Step Resolution Guide

Step 1: Verify the Backup File Integrity

  • Check the file size of the .bak file on disk — compare it to the expected size from your backup job logs or monitoring tool.
  • Navigate to the backup location, e.g., C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\, and confirm the file isn’t 0 KB or unusually small.
  • Run RESTORE VERIFYONLY FROM DISK = 'C:\Backups\YourDB.bak' in SQL Server Management Studio (SSMS) to check header validity before attempting a full restore.

Step 2: Confirm File Transfer Method (If Moved Between Servers)

  • If the backup was copied from another server or downloaded from cloud storage (e.g., Azure Blob, SFTP, FTP), ensure it was transferred in Binary mode, not ASCII/Text mode.
  • For FTP transfers, explicitly set TYPE I (binary) before transferring the file.
  • Re-copy the file using Robocopy or a direct SMB share instead of FTP where possible:
    robocopy "\\SourceServer\Backups" "C:\Backups" YourDB.bak

Step 3: Check SQL Server Version Compatibility

  • Confirm the backup wasn’t created on a newer version of SQL Server (e.g., SQL Server 2025) and is being restored on an older instance (e.g., SQL Server 2019 or 2022).
  • Run SELECT @@VERSION on both the source and destination instances to compare versions.
  • If versions are mismatched, restore the backup only on an instance of SQL Server 2025 or later, or request a backup taken at a compatible compatibility level.

Step 4: Rule Out Antivirus or Backup Software Interference

  • Open Windows Security > Virus & threat protection > Exclusions and add the SQL Server backup directory (e.g., C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\) to prevent real-time scanning from locking or modifying files during write operations.
  • Temporarily disable third-party backup compression agents and re-run a fresh native backup using BACKUP DATABASE YourDB TO DISK = 'C:\Backups\YourDB_Fresh.bak' WITH INIT, CHECKSUM;

Step 5: Re-Generate a Clean Backup (If File Is Confirmed Corrupt)

  • If verification fails consistently, the original backup file is unrecoverable — go back to the source server and generate a new backup.
  • Use the WITH CHECKSUM option during backup creation going forward to catch corruption early:
    BACKUP DATABASE YourDB TO DISK = 'C:\Backups\YourDB.bak' WITH CHECKSUM, STATS = 10;

Alternative or Verification Steps

  • Run RESTORE HEADERONLY FROM DISK = 'C:\Backups\YourDB.bak' — if this succeeds without error, the file header is intact and the issue may lie elsewhere (e.g., permissions on the restore target).
  • If native restore continues to fail, try a third-party tool (e.g., ApexSQL Restore or SQL Backup Master) to attempt a partial data extraction from the damaged file as a last resort before restoring from an older, known-good backup.