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

Why This Error Happens

Error 860 typically occurs when SQL Server’s Buffer Pool Extension (BPE) feature encounters an inconsistency between the in-memory buffer descriptor and the actual data stored on the extension file. This is most commonly caused by an unexpected I/O failure, a corrupted BPE cache file, or a mismatch between the database file offset and the extension offset due to a hardware-level write failure. In rare cases, this also surfaces when the underlying SSD/NVMe drive hosting the .bpe file has suffered sudden disconnection or driver-level corruption during peak read activity.

Step-by-Step Resolution Guide

Step 1: Disable and Remove the Corrupted Buffer Pool Extension File

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run the following T-SQL command to disable BPE immediately:
ALTER SERVERCONFIGURATION SET BUFFER POOL EXTENSION OFF;
  • Manually delete the orphaned .bpe file from its storage path (commonly found under D:\SQLCache\ or wherever it was configured).

Step 2: Verify Disk Health and Storage Drivers

  • Open Event Viewer on Windows Server 2025/Windows 11 and check the System log for Disk or Storport errors (Event ID 7 or 153) around the same timestamp as Error 860.
  • Run chkdsk D: /f /r (replace D: with the actual BPE drive letter) during a scheduled maintenance window to repair file system-level corruption.
  • Update storage drivers via Device Manager > Disk Drives > Update Driver, especially if using NVMe RAID controllers.

Step 3: Re-enable Buffer Pool Extension on a Stable Volume

  • Recreate the BPE file on a different, verified-healthy drive using:
ALTER SERVERCONFIGURATION 
SET BUFFER POOL EXTENSION ON 
(FILENAME = 'E:\SQLCache\BPE_Cache.bpe', SIZE = 50 GB);
  • Ensure the SQL Server service account has Full Control permissions on the new folder path (E:\SQLCache\).
  • Restart the SQL Server service via services.msc to apply the configuration.

Step 4: Run DBCC CHECKDB on Affected Database File

  • Identify the Database file id and Database file offset values from the original error message.
  • Run the following command against the specific database to confirm there is no deeper physical corruption:
DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for any allocation or consistency errors tied to the reported file ID.

Alternative or Verification Steps

  • Monitor the SQL Server Error Log and Windows Event Viewer for 24-48 hours to confirm Error 860 does not recur after re-enabling BPE.
  • If the error persists even after replacing the BPE file, disable Buffer Pool Extension permanently and rely on physical RAM allocation, as this indicates a deeper hardware-level incompatibility rather than a software corruption issue.

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

Why This Error Happens

Event ID 857 is technically a success/informational message, confirming that the Buffer Pool Extension (BPE) file has mounted correctly on the specified SSD path. However, this message frequently appears repeatedly in the SQL Server Error Log when the BPE is being re-initialized due to unexpected service restarts, a misconfigured file path pointing to slower storage, or a size allocation that doesn’t align with the physical RAM-to-SSD ratio recommended by Microsoft. In Windows Server 2025 environments, this can also surface due to disk permission resets during Windows Update cycles, causing SQL Server to drop and remount the extension file on every service start.

Step-by-Step Resolution Guide

Step 1: Verify the BPE File Location and Storage Type

  • Open SQL Server Management Studio (SSMS) and run: SELECT * FROM sys.dm_os_buffer_pool_extension_configuration;
  • Confirm the path column points to a dedicated SSD/NVMe drive, not a spinning HDD or network share.
  • Avoid placing the .BPE file on the same volume as tempdb or the OS page file to prevent I/O contention.

Step 2: Validate File System Permissions

  • Navigate to the folder housing the BPE file (e.g., D:\SQLBPE\).
  • Right-click → Properties → Security tab.
  • Ensure the NT SERVICE\MSSQLSERVER (or your named instance service account) has Full Control.
  • Reapply permissions if a recent Windows Server 2025 security patch reset inherited ACLs.

Step 3: Reconfigure the Buffer Pool Extension Size

  • Disable the current extension:
    ALTER SERVERCONFIGURATION SET BUFFERPOOLEXTENSION OFF;
  • Re-enable it with a size calculated at 4x–10x your physical RAM (do not exceed SSD capacity):
    ALTER SERVERCONFIGURATION SET BUFFERPOOLEXTENSION ON (FILENAME = 'D:\SQLBPE\Instance01.BPE', SIZE = 64 GB);
  • Restart the SQL Server (MSSQLSERVER) service via Services.msc or net stop/start MSSQLSERVER.

Step 4: Check for Recurring Service Restarts

  • Open Event Viewer → Windows Logs → System to check for unexpected reboots or service crashes coinciding with the BPE re-initialization timestamps.
  • If Windows Server 2025 automatic maintenance or cluster failover is triggering restarts, adjust the Failover Cluster Manager or Task Scheduler maintenance windows to avoid conflicts during peak hours.

Alternative or Verification Steps

  • Run SELECT * FROM sys.dm_os_buffer_pool_extension_configuration; and confirm state_description returns “NORMAL” rather than “INITIALIZING” on each check.
  • If the message persists on every restart, move the BPE file to a different physical SSD controller/port, as Windows Server 2025 driver-level disk timeouts can intermittently force SQL Server to treat the file as “new” on each load.

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

Troubleshooting Guide: SQL Server Error 858 – Buffer Pool Extension Creation Failure

Why This Error Happens

Error 858 occurs when SQL Server 2025 cannot allocate or create the Buffer Pool Extension (BPE) file at the specified path. This is typically caused by insufficient NTFS permissions for the SQL Server service account on the target directory, the destination drive not having enough free disk space to accommodate the requested extension size, or the path pointing to unsupported storage media (such as a network drive or a volume without proper disk alignment). In some cases, the underlying file may also be locked or corrupted from a previous failed initialization attempt.

Step-by-Step Resolution Guide

Step 1: Verify NTFS Permissions on the Target Path

  • Open File Explorer and navigate to the folder specified in the BPE path (e.g., D:\SQLCache\).
  • Right-click the folder, select Properties > Security, and confirm the SQL Server service account (e.g., NT SERVICE\MSSQLSERVER) has Full Control.
  • If missing, click Edit > Add, type the service account name, and grant Modify and Write permissions.
  • Restart the SQL Server service after applying changes using services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 2: Confirm Disk Space and Drive Compatibility

  • Check available free space on the target volume using Get-PSDrive D in PowerShell; ensure it exceeds the requested BPE size with headroom.
  • Verify the drive is a local, fixed disk (SSD recommended) — BPE does not support network shares (UNC paths) or removable media.
  • If space is insufficient, either resize the volume or point the BPE to a different local drive with adequate capacity.

Step 3: Recreate the Buffer Pool Extension Configuration

  • Disable the existing BPE configuration in SQL Server Management Studio (SSMS) or via T-SQL:
ALTER SERVER CONFIGURATION SET BUFFER POOL EXTENSION OFF;
  • Delete any residual .BPE file left in the target directory from the failed attempt.
  • Re-enable the BPE with a corrected path and validated size:
ALTER SERVER CONFIGURATION 
SET BUFFER POOL EXTENSION ON 
(FILENAME = 'D:\SQLCache\BPE.BPE', SIZE = 8192 MB);

Step 4: Check Windows Event Viewer for Underlying I/O Errors

  • Open Event Viewer and navigate to Windows Logs > Application.
  • Filter for Source: MSSQLSERVER and cross-reference Error 858 timestamps with any disk I/O warnings (Event ID 153 or 157).
  • If disk-level errors are present, run chkdsk D: /f to repair file system inconsistencies before retrying.

Alternative or Verification Steps

  • Confirm the fix by querying sys.dm_os_buffer_pool_extension_configuration in SSMS — the state_description column should display NORMAL if the BPE initialized successfully.
  • If the error persists on the original drive, as a workaround, configure the Buffer Pool Extension on a different local volume with simpler permission inheritance (e.g., a dedicated E:\BPECache drive with default Administrators and SQL service account access only).

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

Why This Error Happens

SQL Server Error 855 occurs when the Database Engine detects an uncorrectable memory error at the hardware level, typically flagged by the CPU’s Machine Check Architecture (MCA) before SQL Server can validate page checksums. This is almost always caused by failing or degraded physical RAM modules, though it can also stem from faulty CPU cache lines or motherboard memory controller issues. Unlike logical corruption, this error indicates a physical hardware fault rather than a software or permissions problem, meaning Windows itself logged a hardware exception that SQL Server surfaced to protect data integrity.

Step-by-Step Resolution Guide

Step 1: Check the Windows System Event Log

  • Open Event Viewer and navigate to Windows Logs > System.
  • Filter for Event ID 1 (WHEA-Logged) and Event ID 18 (Machine Check Exception) sources.
  • Note the exact timestamp matching the SQL Server Error 855 occurrence to correlate the hardware fault.
  • Run wevtutil qe System /q:"*[System[(EventID=1)]]" /f:text in an elevated PowerShell window for a quick export.

Step 2: Run Windows Memory Diagnostic and Vendor Tools

  • Launch mdsched.exe and select Restart now and check for problems.
  • For production servers, prefer vendor-specific diagnostics (Dell ePSA, HPE iLO Diagnostics, or Lenovo Diagnostic Tool) since they test ECC memory more thoroughly than the built-in tool.
  • Check the server’s BIOS/iDRAC/iLO event log for any pre-failure DIMM alerts or ECC correctable error counts exceeding threshold.

Step 3: Identify and Replace the Faulty DIMM

  • Cross-reference the physical memory address reported in the WHEA event with the DIMM slot mapping in your server’s hardware manual.
  • Physically reseat the suspected DIMM module first, as corrosion or poor seating can mimic hardware failure.
  • If reseating does not resolve repeated errors, replace the DIMM and run a 24-hour burn-in test using MemTest86 before returning the server to production.

Step 4: Restore the Affected SQL Server Database

  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to confirm whether page-level corruption occurred.
  • Restore the affected database from the last known-good full backup plus transaction log backups if corruption is confirmed.
  • Avoid using REPAIR_ALLOW_DATA_LOSS as a first option since the corruption originates from hardware, not logical structure.

Alternative or Verification Steps

  • After hardware replacement, monitor the System Event Log for 48–72 hours to confirm no new WHEA or Event ID 855 entries appear, and re-run DBCC CHECKDB on all user databases to confirm integrity.
  • If the server lacks ECC memory, consider migrating the workload to hardware that supports ECC RAM, since non-ECC systems cannot detect or correct single-bit memory errors before they propagate to SQL Server.

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

SQL Server Error 856: Hardware Memory Corruption Troubleshooting Guide

Why This Error Happens

Error 856 occurs when SQL Server’s internal memory scanning mechanism detects a mismatch between data read from a page in the buffer pool and what it expects to find, indicating physical RAM corruption rather than a software bug. This is typically caused by faulty or failing physical memory modules (DIMMs), unstable memory timings/overclocking, or firmware-level issues on the motherboard that allow bit-flips to occur undetected. Unlike logical corruption caused by disk I/O errors, this error points directly to the hardware memory subsystem, meaning the data corruption happened while the page was already resident in RAM.

Step-by-Step Resolution Guide

Step 1: Isolate the Database and Assess Immediate Risk

  • Take note of the specific database named in the error message (%ls) and check the SQL Server Error Log for the specific Page ID and allocation unit affected.
  • Immediately run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to determine if the corruption has been written to disk or if it was caught in memory before being persisted.
  • If the corruption is isolated to memory (not yet flushed to disk), consider restarting the SQL Server service to clear the buffer pool and force a re-read from disk, which may resolve the immediate symptom temporarily.

Step 2: Run Hardware Diagnostics on Windows Server 2025 / Windows 11

  • Boot into the Windows Memory Diagnostic Tool by typing mdsched.exe into the Run dialog (Win + R) and select “Restart now and check for problems.”
  • Alternatively, download and run a more aggressive third-party tool like MemTest86 via a bootable USB to test RAM sticks individually over multiple passes (recommended: at least 4-8 passes to catch intermittent errors).
  • Check the Windows Event Viewer under Windows Logs > System for Event ID 1001 (WHEA-Logger) or Hardware Error source warnings, which often correlate with SQL Server’s Error 856 timestamp.

Step 3: Physically Inspect and Isolate Faulty DIMMs

  • If MemTest86 or Windows Memory Diagnostic identifies a specific failing module, power down the server and physically remove the faulty DIMM from the motherboard slot.
  • Re-seat all remaining RAM modules to rule out a poor connection, ensuring they are matched in speed and voltage according to the motherboard manufacturer’s QVL (Qualified Vendor List).
  • Update the system’s BIOS/UEFI firmware to the latest version, as memory controller bugs are frequently patched in firmware updates for Windows Server 2025 compatible hardware.

Step 4: Restore Data and Verify Database Integrity

  • Once faulty hardware is removed or replaced, restore the affected database from the last known good backup taken prior to the corruption event if DBCC CHECKDB reported unrecoverable errors.
  • If no clean backup is available, use DBCC CHECKDB('YourDatabaseName') WITH REPAIR_ALLOW_DATA_LOSS; as a last resort, understanding that this may result in the loss of the specific corrupted rows/pages.
  • Enable Page Checksums (ALTER DATABASE... SET PAGE_VERIFY CHECKSUM;) if not already active, allowing SQL Server to proactively detect similar hardware issues immediately upon disk I/O rather than relying solely on buffer scans.

Alternative or Verification Steps

  • Verification: After re-seating/replacing RAM, run DBCC CHECKDB on all critical databases for 24-48 hours under normal load to ensure Error 856 does not recur in the SQL Server Error Log.
  • Alternative: If the server utilizes ECC (Error-Correcting Code) RAM but corruption persists, check the hardware vendor’s specific diagnostic utility (e.g., Dell OpenManage or HPE iLO) to view the ECC error correction logs, as this may indicate a failing memory controller on the CPU rather than the RAM sticks themselves.

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

Troubleshooting Guide: SQL Server Error 852 — “Using Conventional Memory in the Memory Manager”

Why This Error Happens

This error occurs when SQL Server 2025 fails to initialize or allocate memory using the standard Locked Pages/Large Page Extensions API and instead falls back to conventional (non-locked) memory allocation. This fallback is typically triggered because the SQL Server service account lacks the “Lock Pages in Memory” user rights assignment, or the server is running under memory pressure that prevents large page allocation at startup. In virtualized or containerized Windows Server 2025 environments, this can also happen if dynamic memory ballooning interferes with the initial large page reservation.

Step-by-Step Resolution Guide

Step 1: Grant “Lock Pages in Memory” Rights to the SQL Service Account

  • Open secpol.msc (Local Security Policy) on the Windows Server 2025 host, or use Group Policy Management on a domain controller if centrally managed.
  • Navigate to Local Policies > User Rights Assignment > Lock pages in memory.
  • Add the SQL Server service account (e.g., NT SERVICE\MSSQLSERVER or your custom domain service account) to this policy.
  • Restart the SQL Server service for the policy to take effect: net stop MSSQLSERVER && net start MSSQLSERVER.

Step 2: Verify Physical Memory and Startup Allocation Settings

  • Confirm the host has sufficient contiguous physical RAM available at SQL Server startup; avoid starting SQL Server immediately after a reboot while other services are still consuming memory.
  • Check max server memory configuration via SSMS or T-SQL: EXEC sp_configure 'max server memory'.
  • Ensure max server memory is set appropriately below total physical RAM (leave 10-20% for OS overhead) to prevent allocation conflicts: EXEC sp_configure 'max server memory', 16384; RECONFIGURE;.

Step 3: Disable Dynamic Memory (If Running on Hyper-V or Virtual Host)

  • If SQL Server 2025 is hosted on a Hyper-V virtual machine, open Hyper-V Manager on the host.
  • Right-click the VM, select Settings > Memory, and uncheck Enable Dynamic Memory.
  • Assign a fixed static memory allocation instead, ensuring it matches or exceeds the SQL Server max server memory setting plus OS overhead.

Step 4: Check SQL Server Error Log for Confirmation

  • Open the SQL Server Error Log via SSMS (Management > SQL Server Logs) or via xp_readerrorlog.
  • Look for related messages such as “Failed to initialize sqllang.dll” or memory-related warnings occurring just before Error 852.
  • Cross-reference with Windows Event Viewer (Windows Logs > System) for Event ID 852 and correlated memory-pressure warnings.

Alternative or Verification Steps

  • After applying the fixes, restart the SQL Server service and check the Error Log for the message “Using locked pages in the memory manager” instead of “conventional memory” — this confirms the Lock Pages in Memory setting is now active.
  • If the error persists, run DBCC MEMORYSTATUS in SSMS to inspect current memory allocation details and confirm whether large pages are being used; if not, re-verify Group Policy replication has applied correctly across the domain.

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

Troubleshooting Guide: SQL Server Error 853 – “Latch Acquire Failed Due to Too Many Concurrent Latches”

Why This Error Happens

This error occurs when SQL Server 2025’s internal latch manager exceeds the maximum number of concurrent latches allowed for a specific resource type (indicated by type %d), typically under heavy concurrent workloads on memory-optimized tables or internal B-tree structures. It is often triggered by excessive parallelism, undersized memory allocation for the Hekaton/In-Memory OLTP engine, or a high volume of simultaneous transactions contending for the same page or row structures. In some cases, outdated Cumulative Updates on SQL Server 2025 running on Windows Server 2025 can exacerbate this due to known latch contention bugs in early builds.

Step-by-Step Resolution Guide

Step 1: Identify the Latch Type and Contention Source

  • Query sys.dm_os_latch_stats to identify which latch class is generating the highest wait time.
  • Run DBCC SQLPERF('sys.dm_os_wait_stats') to correlate latch waits with overall server wait statistics.
  • Check SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the exact timestamp and structure type referenced in the 853 error.

Step 2: Reduce Concurrency Pressure on Affected Structures

  • Lower the max degree of parallelism (MAXDOP) setting via SSMS: Right-click Server → Properties → Advanced → set MAXDOP to a value matching NUMA node core count (commonly 4–8).
  • If the issue involves memory-optimized tables, review and reduce the number of concurrent sessions hitting the same hash index using sys.dm_db_xtp_hash_index_stats.
  • Adjust application-level connection pooling to throttle simultaneous write operations against the same table.

Step 3: Apply Latest Cumulative Update and Patch OS

  • Download and install the latest Cumulative Update (CU) for SQL Server 2025 from the Microsoft Update Catalog.
  • Verify Windows Server 2025 / Windows 11 has all current updates via Settings → Windows Update → Check for updates.
  • Restart the SQL Server service after patching: net stop MSSQLSERVER && net start MSSQLSERVER.

Step 4: Increase Internal Resource Allocation (If Applicable)

  • If using In-Memory OLTP, increase the memory allocated to the resource pool via sys.sp_xtp_control_proc_exec_stats and the Resource Governor.
  • Verify tempdb has multiple data files (recommended: one per logical CPU core, up to 8) to reduce latch contention on system pages.
  • Add files using: ALTER DATABASE tempdb ADD FILE (NAME = tempdev2, FILENAME = 'D:\SQLData\tempdb2.ndf', SIZE = 512MB).

Alternative or Verification Steps

  • Re-run the previously failing workload and monitor sys.dm_os_latch_stats to confirm latch wait times have dropped to baseline levels.
  • If the error persists, open a support case with Microsoft and include the SQLDIAG output along with Extended Events traces capturing the latch_suspend_begin and latch_suspend_end events for root-cause analysis.

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

Why This Error Happens

Error 854 is an informational message, not a failure, that SQL Server 2025 writes to the error log when it detects that the underlying hardware and Windows Server 2025/Windows 11 kernel support Hardware Error Recovery (also known as Windows Hardware Error Architecture, or WHEA). When this capability is detected, the Database Engine automatically enables a memory-page protection mechanism that allows it to isolate and recover from certain classes of physical memory corruption without crashing the instance. This message typically appears because the server’s firmware, chipset, and OS have been upgraded or reconfigured to support this feature, and SQL Server is simply confirming that the protective mode is now active.

Step-by-Step Resolution Guide

Step 1: Confirm This Is Informational, Not a Critical Failure

  • Open the SQL Server Error Log via SSMS (Management > SQL Server Logs) or check ERRORLOG in C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\.
  • Search for Event ID 854 and confirm the message text reads “Machine supports memory error recovery… SQL memory protection is enabled.”
  • Verify there are no accompanying 823, 824, or 825 errors, which would indicate actual I/O or memory corruption rather than this benign notification.

Step 2: Validate Hardware Error Recovery Configuration in Windows

  • Open PowerShell as Administrator and run Get-WmiObject -Namespace root\WMI -Class WheaErrorRecord to inspect any logged hardware error events.
  • Check Windows Event Viewer under Windows Logs > System, filtering for Source “WHEA-Logger” to confirm no active hardware faults are being reported.
  • Ensure your server’s BIOS/UEFI firmware is updated to the latest vendor version, as outdated firmware can cause inconsistent WHEA reporting.

Step 3: Review SQL Server Startup Parameters and Trace Flags

  • Open SQL Server Configuration Manager and check the Startup Parameters tab for the MSSQLSERVER service.
  • Confirm no conflicting trace flags (e.g., -T845 or memory-related flags) are forcing non-standard memory allocation behavior.
  • Restart the SQL Server service via net stop MSSQLSERVER followed by net start MSSQLSERVER to re-initialize memory protection cleanly.

Step 4: Monitor for Recurrence and Correlate with Hardware Diagnostics

  • Use Windows Performance Monitor (perfmon.exe) to track the “Memory\% Committed Bytes In Use” and “SQLServer:Memory Manager\Total Server Memory” counters over a 24-48 hour period.
  • Run chkdsk C: /f /r during a maintenance window and check physical RAM health using vendor diagnostic tools (e.g., Dell SupportAssist, HPE iLO Diagnostics) to rule out failing DIMMs.

Alternative or Verification Steps

  • Verify the fix by restarting the SQL Server service and confirming Event ID 854 reappears only once at startup without any subsequent 823/824/825 corruption errors in the ERRORLOG.
  • If actual memory corruption is suspected despite this informational message, run DBCC CHECKDB against all databases and consider running Windows Memory Diagnostic (mdsched.exe) to rule out physical RAM failure.

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

Why This Error Happens

This message is actually an informational event, not a failure—it confirms that SQL Server 2025 successfully enabled Lock Pages in Memory (LPIM) and allocated large pages for the Buffer Pool. It typically appears when the SQL Server service account has been granted the “Lock Pages in Memory” user right and the server is running Enterprise Edition with sufficient contiguous physical memory. However, if you’re troubleshooting this because of unexpected memory pressure or startup delays, the root cause is usually that large page allocation reserves memory in large contiguous blocks upfront, which can fail or delay startup if the OS cannot find enough contiguous physical RAM due to fragmentation.

Step-by-Step Resolution Guide

Step 1: Verify the Lock Pages in Memory Policy

  • Open secpol.msc or gpedit.msc on Windows Server 2025.
  • Navigate to Local Policies > User Rights Assignment > Lock pages in memory.
  • Confirm the SQL Server service account (e.g., NT Service\MSSQLSERVER or a domain service account) is listed.
  • If missing, add the account, then restart the SQL Server service for the policy to take effect.

Step 2: Check Physical Memory and Fragmentation

  • Run systeminfo in an elevated Command Prompt to confirm total physical RAM matches expectations.
  • Use Performance Monitor (perfmon) and add the counter Memory > Available MBytes to check for fragmentation issues during startup.
  • If memory is highly fragmented (common after long uptime or many application restarts), schedule a server reboot to consolidate contiguous memory blocks.

Step 3: Confirm Trace Flag and Startup Configuration

  • Open SQL Server Configuration Manager and check the Startup Parameters tab for the SQL Server service.
  • Ensure no conflicting trace flags (like -T834, which forces large page allocation for the buffer pool) are misconfigured for your hardware capacity.
  • If -T834 is enabled on a system with limited RAM, consider removing it to allow standard page allocation instead, reducing startup memory pressure.

Step 4: Review SQL Server Error Log for Context

  • Open the SQL Server Error Log via SSMS (Management > SQL Server Logs) or navigate to the log file directly at:
    C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG
  • Search for Event ID 850 entries and note the MB value reported.
  • Cross-reference this value against max server memory settings in sp_configure to ensure allocation aligns with your intended Buffer Pool size.

Alternative or Verification Steps

  • Run SELECT * FROM sys.dm_os_sys_info; in SSMS and check the sql_memory_model_desc column—it should return LOCK_PAGES if large page allocation succeeded correctly.
  • If startup times remain slow despite correct configuration, temporarily disable Lock Pages in Memory, restart the service, and confirm whether standard memory allocation resolves the delay before re-enabling it with adjusted max server memory limits.

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

Troubleshooting Guide: SQL Server Error 851 — “The page is in an OFFLINE file which cannot be read”

Why This Error Happens

Error 851 occurs when SQL Server 2025 attempts to read a data page that resides in a filegroup or database file currently marked as OFFLINE, often because the file was manually taken offline, is missing from its expected path, or failed to recover after a crash or storage disconnection. This can also happen when a filegroup containing critical pages is intentionally set offline during partial database availability scenarios, but a query still attempts to touch that unavailable file. Underlying causes typically include storage connectivity loss (SAN/NAS failure), incomplete restore operations, or manual administrative actions that left the file in an inconsistent OFFLINE state.

Step-by-Step Resolution Guide

Step 1: Identify the Offline File and Database

  • Run the following query to locate which file is offline:
  SELECT name, physical_name, state_desc 
  FROM sys.master_files 
  WHERE state_desc = 'OFFLINE';
  • Note the database_id, file_id, and physical_name for the affected file.
  • Check SQL Server Error Log (via SSMS > Management > SQL Server Logs) for related messages confirming why the file went offline (e.g., I/O error, disk disconnect).

Step 2: Verify Storage and File Path Accessibility

  • Confirm the physical file still exists at the path reported in Step 1.
  • Check Windows Server 2025 Disk Management or File Explorer to ensure the volume hosting the .mdf/.ndf file is mounted and healthy.
  • Validate the SQL Server service account has Read/Write/Modify permissions on the folder:
  Right-click folder > Properties > Security > Edit > Add "NT SERVICE\MSSQLSERVER"
  • If the disk was disconnected (common in VM/cloud storage scenarios), reattach the volume and restart the SQL Server service via services.msc.

Step 3: Bring the File Back Online

  • Once the physical file and permissions are confirmed, run:
  ALTER DATABASE [YourDatabaseName] 
  MODIFY FILE (NAME = 'YourLogicalFileName', OFFLINE = OFF);

  ALTER DATABASE [YourDatabaseName] 
  SET ONLINE;
  • If the file is part of a filegroup, bring the filegroup online instead:
  ALTER DATABASE [YourDatabaseName] 
  MODIFY FILEGROUP [YourFileGroupName] ONLINE;

Step 4: Run Consistency Checks

  • Execute DBCC CHECKDB against the database to confirm no corruption remains after bringing the file online:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review output for any additional allocation or page-level errors that may require a restore from backup.

Alternative or Verification Steps

  • Re-run the original query or job that triggered Error 851 to confirm the page is now readable without exception.
  • If the file cannot be brought online due to corruption, restore the affected file/filegroup from the most recent valid backup using RESTORE DATABASE ... FILE = 'LogicalFileName' with NORECOVERY, followed by applying transaction log backups to bring it current.

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

Troubleshooting Guide: SQL Server 2025 Error 848 – Large Page Allocation Failure

Why This Error Happens

Error 848 occurs when the SQL Server Database Engine attempts to use Large Page Extensions for memory allocation but fails due to insufficient privileges on the service account. This typically happens because the “Lock Pages in Memory” policy has not been granted to the SQL Server service account, or the system lacks a contiguous block of physical memory large enough to satisfy the large page request (usually requiring at least 2GB of RAM and a server restart after configuration). Additionally, this can occur if the memory is heavily fragmented by other running processes at the time the SQL Server service starts.

Step-by-Step Resolution Guide

Step 1: Grant “Lock Pages in Memory” Privilege

  • Open the Local Security Policy editor (secpol.msc) on Windows Server 2025, or use Group Policy Management if domain-joined.
  • Navigate to Security Settings > Local Policies > User Rights Assignment.
  • Locate the policy named “Lock pages in memory” and double-click to open properties.
  • Click Add User or Group and enter the service account used to run the SQL Server (MSSQLSERVER) service (e.g., NT Service\MSSQLSERVER or a custom domain service account).
  • Click OK and close the Local Security Policy editor.

Step 2: Verify Memory Requirements and Edition Support

  • Confirm the server has sufficient physical RAM installed; Large Page support is generally only engaged when the system has 2GB or more of memory and is running Enterprise or Developer Edition.
  • Check the System Information panel to ensure no memory-hungry background processes (like Hyper-V dynamic memory allocation) are fragmenting available RAM before the SQL service starts.
  • If running on a Hyper-V Virtual Machine, ensure Dynamic Memory is disabled and a fixed amount of RAM is allocated to the VM to prevent fragmentation.

Step 3: Restart the SQL Server Service

  • A restart is mandatory for the “Lock Pages in Memory” privilege to take effect.
  • Open SQL Server Configuration Manager.
  • Right-click on the SQL Server (MSSQLSERVER) service and select Restart.
  • Alternatively, use PowerShell to restart the service: Restart-Service -Name 'MSSQLSERVER' -Force.

Step 4: Review the SQL Server Error Log

  • After the restart, open the SQL Server Error Log via SSMS or navigate to the default log path: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Search for the specific text string: “Using large pages in the memory manager” to confirm the engine successfully initialized the feature without throwing Error 848.

Alternative or Verification Steps

  • Verification: Run the query SELECT * FROM sys.dm_os_sys_info and check the sql_memory_model_desc column; if large pages are successfully enabled, this value should return LOCK_PAGES instead of CONVENTIONAL.
  • Alternative Fix: If the error persists due to memory fragmentation despite correct permissions, perform a full restart of the Windows Server 2025 host (not just the SQL service) to clear the Windows memory manager’s allocation table and defragment available RAM.

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

Why This Error Happens

Error 849 is logged by the SQL Server 2025 Memory Manager when it initializes and successfully reserves non-paged memory for the buffer pool using the “Lock Pages in Memory” (LPIM) privilege. This message typically surfaces as a troubleshooting concern when administrators expect standard memory paging behavior but instead see locked memory, or conversely, when the service account lacks the correct privilege assignment and SQL Server falls back to conventional memory allocation. The root cause is almost always tied to Local Security Policy configuration, specifically whether the SQL Server service account has been granted the “Lock pages in memory” user right on the Windows Server 2025 / Windows 11 host.

Step-by-Step Resolution Guide

Step 1: Verify the Service Account Context

  • Open SQL Server Configuration Manager.
  • Navigate to SQL Server Services and confirm the exact account running the SQL Server (MSSQLSERVER) service (e.g., NT SERVICE\MSSQLSERVER or a domain service account like DOMAIN\svc_sql).
  • Note this account precisely, as it must match the account granted rights in the next step.

Step 2: Assign the “Lock Pages in Memory” Privilege

  • Press Win + R, type secpol.msc, and press Enter to open Local Security Policy.
  • Go to Security Settings > Local Policies > User Rights Assignment.
  • Double-click Lock pages in memory, click Add User or Group, and add the SQL Server service account identified in Step 1.
  • Click Apply, then OK.

Step 3: Restart the SQL Server Service

  • Return to SQL Server Configuration Manager.
  • Right-click SQL Server (MSSQLSERVER) (or your named instance) and select Restart.
  • This forces the Memory Manager to re-initialize and apply the new LPIM privilege on startup.

Step 4: Confirm Enterprise/Standard Edition Behavior

  • Check that you are running an edition of SQL Server 2025 that supports locked pages (Standard, Enterprise, or Developer).
  • For Standard Edition, confirm trace flag 845 is not required (it was deprecated in modern builds) and that LPIM is natively supported without additional flags.

Step 5: Validate via SQL Server Error Log

  • Open the SQL Server Error Log via SSMS (Management > SQL Server Logs).
  • Confirm the presence of message: “Using locked pages in the memory manager” without any accompanying warning about failed privilege assignment (Error 845 would indicate failure).

Alternative or Verification Steps

  • Run the query SELECT large_page_allocations_kb, locked_page_allocations_kb FROM sys.dm_os_process_memory; in SSMS — a non-zero value in locked_page_allocations_kb confirms locked pages are active and functioning correctly.
  • If the privilege still fails to apply after a Group Policy refresh, run gpupdate /force from an elevated Command Prompt and restart the SQL Server service again, as domain-level Group Policy Objects (GPOs) can override local security policy settings.

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

Troubleshooting Guide: SQL Server Error 845 – Buffer Latch Time-Out

Why This Error Happens

Error 845 occurs when a SQL Server thread cannot acquire a buffer latch (a lightweight synchronization lock) on a specific data page within the configured time-out period. This is typically caused by severe I/O subsystem bottlenecks, disk controller driver issues, or underlying storage latency that prevents the page from being read into or flushed out of the buffer pool fast enough. It can also surface due to resource contention from excessive parallelism, antivirus/filter drivers intercepting the data file I/O path, or underlying disk corruption that causes repeated failed read attempts.

Step-by-Step Resolution Guide

Step 1: Check SQL Server Error Log and Windows Event Viewer for I/O Correlation

  • Open SQL Server Management Studio (SSMS) and review SQL Server Error Log for accompanying messages (e.g., Error 833 “I/O taking longer than 15 seconds”).
  • Cross-reference Windows Event Viewer under Windows Logs > System for Disk, Storport, or Storahci warnings around the same timestamp.
  • Note the database name and %S_PGID (page ID) reported to isolate which file/filegroup is affected.

Step 2: Validate Storage Health and Disk Latency

  • Run Get-PhysicalDisk | Get-StorageReliabilityCounter in PowerShell (Windows Server 2025) to check for read/write errors or high latency on the drives hosting .mdf/.ldf files.
  • Use Performance Monitor (perfmon.exe) and add counters Avg. Disk sec/Read and Avg. Disk sec/Write; values consistently above 20ms indicate a storage bottleneck.
  • If using SAN/NAS storage, confirm multipathing (MPIO) drivers are up to date and functioning correctly.

Step 3: Exclude SQL Server Files from Antivirus/Filter Drivers

  • Navigate to your antivirus console and exclude the following paths from real-time scanning:
  • C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\
  • Any custom paths hosting .mdf, .ndf, .ldf, and .bak files.
  • Restart the SQL Server (MSSQLSERVER) service via services.msc to apply the exclusion cleanly.

Step 4: Run DBCC CHECKDB to Rule Out Corruption

  • Open a query window in SSMS and execute:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is found on the specific page ID referenced in the 845 error, restore the affected page or database from a verified clean backup.

Step 5: Adjust Max Degree of Parallelism (MAXDOP) and Memory Configuration

  • Right-click the instance in SSMS > Properties > Advanced, and set Max Degree of Parallelism to a value matching NUMA node core count (commonly 4–8, not 0).
  • Under Memory, ensure Max Server Memory is set to leave at least 4GB free for the OS (e.g., if the server has 32GB RAM, set max to 28000 MB).
  • Restart the SQL Server service to apply changes.

Alternative or Verification Steps

  • After applying fixes, monitor sys.dm_os_wait_stats for PAGELATCH_EX and PAGEIOLATCH_EX wait types over 24-48 hours to confirm reduced wait times.
  • If the error persists despite healthy storage metrics, consider migrating the database files to faster storage (NVMe SSD) or splitting tempdb into multiple data files matching CPU core count.

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

Why This Error Happens

Error 846 occurs when a thread (SPID) requests a latch on a buffer page but cannot acquire it within the configured timeout window, typically because another process is holding an exclusive latch for an extended period. This is commonly caused by I/O subsystem bottlenecks, driver-level disk latency, or storage controller issues preventing pages from being read into or flushed out of the buffer pool fast enough. In some cases, it also signals underlying disk corruption or a failing storage path that is silently stalling I/O completion callbacks.

Step-by-Step Resolution Guide

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

  • Open SQL Server Management Studio (SSMS) and run EXEC sp_readerrorlog; to locate the full 846 message, including the Page ID, File ID, and Latch Type.
  • Open Event Viewer on Windows Server 2025 and navigate to Windows Logs > System to check for disk-related warnings (Event ID 153 or 129) occurring at the same timestamp.
  • Note the database and file path referenced in the error (e.g., D:\SQLData\YourDB.mdf).

Step 2: Validate Storage Health and I/O Latency

  • Run SELECT * FROM sys.dm_io_virtual_file_stats(NULL, NULL); in SSMS to check io_stall_read_ms and io_stall_write_ms for abnormal spikes on the affected file.
  • Use Windows Performance Monitor (PerfMon) to track the Avg. Disk sec/Read and Avg. Disk sec/Write counters on the physical disk hosting your .mdf/.ndf files; values consistently above 20ms indicate a hardware bottleneck.
  • If using virtualized storage (Hyper-V/VMware), verify the VM’s virtual disk controller type (ensure it is SCSI, not IDE) and confirm the underlying SAN/NAS is not saturated.

Step 3: Run Database Consistency Checks

  • Execute DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to rule out physical page corruption as the root cause of the latch delay.
  • If corruption is found, restore the affected database from the last known good backup rather than attempting an in-place repair, as REPAIR_ALLOW_DATA_LOSS may compound data integrity issues.

Step 4: Adjust SQL Server Memory and MAXDOP Settings

  • Open SQL Server Management Studio, right-click the instance, and go to Properties > Memory.
  • Ensure “Maximum server memory” is not configured too aggressively high, leaving insufficient RAM for the Windows Server 2025 OS (leave at least 4GB–8GB free for the OS, depending on total physical RAM).
  • Review MAXDOP settings under Properties > Advanced to prevent excessive parallel threads from competing for the same buffer pages simultaneously.

Alternative or Verification Steps

  • Re-run the workload or query that originally triggered the error while monitoring sys.dm_os_wait_stats for the PAGELATCH_EX or PAGEIOLATCH_EX wait types to confirm wait times have dropped to normal levels.
  • If the issue persists despite healthy storage I/O, consider migrating the database files to a faster storage tier (NVMe/SSD) or enabling Instant File Initialization via Local Security Policy (Perform volume maintenance tasks) to speed up file growth operations.

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

Troubleshooting Guide: SQL Server Error 847 – Latch Timeout

Why This Error Happens

Error 847 occurs when a thread waiting on a buffer latch (a lightweight synchronization object protecting in-memory pages) cannot acquire it within the configured timeout window, typically due to severe I/O subsystem latency or contention on a “hot” page. This is often triggered by underlying disk storage that cannot keep pace with SQL Server’s read/write requests, antivirus or filter drivers intercepting I/O calls to the data files, or a physically/logically corrupted database page causing repeated re-read attempts. Unlike a deadlock, this is a “soft” failure signaling the storage layer or memory subsystem is critically overwhelmed.

Step-by-Step Resolution Guide

Step 1: Verify Storage Subsystem Health and Latency

  • Open Performance Monitor (PerfMon) and add counters for Avg. Disk sec/Read and Avg. Disk sec/Write under the LogicalDisk object for the volume hosting your .mdf/.ldf files.
  • Values consistently above 15-20ms indicate the physical disk array or SAN cannot handle the throughput, directly causing latch timeouts.
  • Check Windows Event Viewer under System logs for any Event ID 129 (disk reset) or storage controller errors occurring at the same timestamp as the Error 847.

Step 2: Exclude SQL Server Files from Antivirus Scanning

  • Navigate to your antivirus management console (e.g., Windows Defender settings via Windows Security > Virus & threat protection > Exclusions).
  • Add exclusions for the following paths to prevent real-time scanning from blocking I/O requests:
  • C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\
  • C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\
  • Also exclude the sqlservr.exe process itself from behavioral monitoring.

Step 3: Run DBCC CHECKDB to Rule Out Page Corruption

  • Open SQL Server Management Studio (SSMS) and connect to the instance reporting the error.
  • Execute the following command against the specific database named in the error log:
  • DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is found on the specific page referenced in the latch error, restore the affected page from a clean backup using RESTORE DATABASE ... PAGE = 'file:page'.

Step 4: Increase the Latch Timeout via Trace Flag (Temporary Mitigation)

  • If storage upgrades are not immediately possible, apply Trace Flag 845 or adjust the latch wait threshold using startup parameters in SQL Server Configuration Manager.
  • Navigate to SQL Server Services > [Your Instance] > Properties > Startup Parameters.
  • Add the flag and restart the SQL Server service to apply the change (Note: this buys time but does not fix underlying I/O bottlenecks).

Alternative or Verification Steps

  • Verify the Fix: Monitor the SQL Server Error Log (SSMS > Management > SQL Server Logs) for 24-48 hours post-fix to confirm Error 847 does not recur, and check that Avg. Disk sec/Read in PerfMon remains below 10ms.
  • Alternative Solution: If the issue persists on virtualized infrastructure (Hyper-V on Windows Server 2025), verify that the virtual disk is not Dynamically Expanding; convert it to a Fixed Size VHDX to eliminate expansion-based I/O stalls.

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

Troubleshooting Guide: SQL Server Error 838 — Asynchronous API Call Timeout

Why This Error Happens

Error 838 occurs when SQL Server’s scheduler detects that an asynchronous API call (often related to disk I/O, storage drivers, or extended events) has not returned within the expected time window, risking a non-yielding scheduler condition. This is typically caused by underlying storage subsystem latency, outdated or corrupted storage/filter drivers, or resource contention from antivirus/filter drivers intercepting I/O calls. It can also result from CPU scheduling starvation on the host (physical or virtual) preventing SQL Server threads from completing their asynchronous operations in time.

Step-by-Step Resolution Guide

Step 1: Check Storage and Disk I/O Health

  • Open Windows Admin Center or Performance Monitor (perfmon.exe) and monitor the Avg. Disk sec/Read and Avg. Disk sec/Write counters on the volumes hosting .mdf/.ldf files.
  • Values consistently above 15-20ms indicate storage latency issues.
  • Review C:\Windows\System32\winevt\Logs\System.evtx for related disk or storahci driver warnings.
  • If using SAN/NAS storage, confirm multipathing (MPIO) drivers are up to date via Get-MPIOSetting in PowerShell.

Step 2: Update Storage and Filter Drivers

  • Navigate to Device Manager > Disk Drives and update storage controller drivers to the latest WHQL-certified version for Windows Server 2025 / Windows 11.
  • Check for third-party filter drivers (antivirus, backup agents) using fltmc.exe in an elevated Command Prompt.
  • Temporarily disable or exclude SQL Server data/log directories (commonly D:\SQLData and E:\SQLLogs) from real-time antivirus scanning.

Step 3: Review SQL Server Configuration and Trace Flags

  • Open SQL Server Configuration Manager and confirm the instance is not oversubscribed on max degree of parallelism relative to available logical CPUs.
  • Check ERRORLOG located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for repeated Error 838 entries and correlate timestamps with I/O spikes.
  • Consider enabling Trace Flag 3614 only under guidance from Microsoft Support to capture additional diagnostic output for async call timeouts.

Step 4: Validate Virtualization/Host Resources (if applicable)

  • If SQL Server runs on a VM (Hyper-V), confirm CPU Reservation and Ready Time metrics on the host are not causing scheduling delays.
  • Use Get-VM | Select Name, CPUUsage, MemoryAssigned in PowerShell on the Hyper-V host to check for resource contention.
  • Ensure Dynamic Memory is disabled for latency-sensitive SQL Server VMs.

Step 5: Apply Latest SQL Server 2025 Cumulative Update

  • Download and install the latest Cumulative Update (CU) from the Microsoft Update Catalog for SQL Server 2025.
  • Run SELECT @@VERSION; in SSMS to confirm the build number matches the latest CU release notes.
  • Restart the SQL Server service via services.msc after installation.

Alternative or Verification Steps

  • Run DBCC CHECKDB and review sys.dm_os_wait_stats for ASYNC_IO_COMPLETION or IO_COMPLETION wait types trending downward after applying fixes.
  • If the error persists after driver and CU updates, open a Microsoft Support case and provide a SQL Server memory dump (.mdmp) generated at the time of the Error 838 event for deep diagnostic analysis.

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

Troubleshooting Guide: Error 844 – “Time Out Occurred While Waiting for Buffer Latch”

Why This Error Happens

Error 844 occurs when a thread requesting a buffer latch cannot acquire it within the configured timeout window, typically because another process is holding the latch for an abnormally long time. This is most often caused by severe I/O subsystem latency, disk controller driver issues, or storage hardware failures preventing pages from being read into or flushed out of the buffer pool. In some cases, it can also stem from internal resource contention or corruption within the database pages themselves, especially following an unclean shutdown or storage-level fault.

Step-by-Step Resolution Guide

Step 1: Check the SQL Server Error Log for Underlying I/O Warnings

  • Open SQL Server Management Studio (SSMS) and navigate to Management > SQL Server Logs.
  • Look for accompanying messages such as “I/O requests taking longer than 15 seconds” near the same timestamp as Error 844.
  • Alternatively, review the raw log file located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.

Step 2: Validate Storage Health and Driver Status on Windows Server 2025

  • Open Device Manager and check the status of Disk Drives and Storage Controllers for yellow warning flags.
  • Run Get-PhysicalDisk | Select DeviceID, HealthStatus, OperationalStatus in PowerShell to confirm drive health.
  • Update storage controller/RAID drivers via Windows Update > Optional Updates or the vendor’s official driver package.
  • If using virtualized storage (Hyper-V/Azure), verify the underlying host storage isn’t throttled or oversubscribed.

Step 3: Run DBCC CHECKDB to Rule Out Page-Level Corruption

  • Execute the following in SSMS against the affected database:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is reported, restore from the most recent clean backup rather than using repair options that allow data loss.
  • Cross-reference corruption page IDs with msdb.dbo.suspect_pages for a historical view.

Step 4: Adjust Buffer Latch Timeout and Monitor Resource Governor Settings

  • If timeouts are tied to heavy workload contention rather than hardware failure, review max server memory and min server memory settings under Server Properties > Memory to ensure SQL Server isn’t memory-starved.
  • Use sys.dm_os_wait_stats to identify if PAGEIOLATCH_SH or PAGEIOLATCH_EX waits are spiking, indicating I/O-bound contention rather than a hardware fault.
  • Consider isolating heavy batch jobs using Resource Governor if multiple workloads compete for the same buffer pages.

Alternative or Verification Steps

  • After applying driver updates or storage fixes, run a sustained I/O stress test using DiskSpd or SQLIO to confirm latency remains under 15ms for reads/writes.
  • Monitor sys.dm_os_wait_stats and the Windows Performance Monitor counter Avg. Disk sec/Read and Avg. Disk sec/Write for 24–48 hours to confirm Error 844 does not recur under normal production load.

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

Why This Error Happens

Error 836 occurs when SQL Server 2025 cannot allocate sufficient memory to complete a database page operation, typically because the instance has hit its configured memory ceiling or the host OS is experiencing memory pressure from other processes. This is commonly triggered by an incorrectly configured “Max Server Memory” setting, a memory leak in a third-party extended stored procedure, or insufficient physical RAM on Windows Server 2025 relative to the workload. In virtualized or containerized Windows 11 dev environments, dynamic memory ballooning by the hypervisor can also starve the SQL Server process unexpectedly.

Step-by-Step Resolution Guide

Step 1: Verify Current Memory Configuration

  • Open SQL Server Management Studio (SSMS) and run: EXEC sp_configure 'show advanced options', 1; RECONFIGURE; EXEC sp_configure 'max server memory';
  • Confirm the value isn’t set too close to total physical RAM (leave at least 4-6 GB for the OS on Windows Server 2025).
  • Check Windows Task Manager (Performance tab) to see if sqlservr.exe is competing with other high-memory processes.

Step 2: Adjust Max and Min Server Memory Settings

  • Run the following to set a safer ceiling (example for a 32 GB host):
    EXEC sp_configure 'max server memory', 24576; RECONFIGURE;
  • Ensure “min server memory” is not set higher than necessary, as this can starve other processes.
  • Restart the SQL Server service via services.msc or NET STOP MSSQLSERVER && NET START MSSQLSERVER for changes to fully apply.

Step 3: Check for Memory Leaks or Third-Party Interference

  • Review SQL Server error logs located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for repeated out-of-memory warnings.
  • Disable or update any CLR assemblies, linked servers, or extended stored procedures that may be leaking memory outside the SQL Server memory manager.
  • Use Windows Performance Monitor (perfmon) with the “Memory\Available MBytes” counter to confirm free system memory isn’t critically low.

Step 4: Increase Physical Resources or Enable Lock Pages in Memory

  • On Windows Server 2025, grant the SQL Server service account the “Lock Pages in Memory” policy via gpedit.msc → Local Computer Policy → User Rights Assignment.
  • If running in a VM, confirm Dynamic Memory is disabled or that a static memory allocation is reserved for the SQL Server VM.
  • If the server is consistently under memory pressure, add physical RAM or migrate heavy workloads to a dedicated instance.

Alternative or Verification Steps

  • After restarting the service, rerun the failing query or job and monitor the ERRORLOG for recurrence of Error 836; also check sys.dm_os_memory_clerks to confirm memory distribution looks healthy.
  • If the error persists despite available memory, run DBCC CHECKDB on the affected Database ID to rule out page-level corruption contributing to the allocation failure.

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

Troubleshooting Guide: SQL Server Error 837

Why This Error Happens

Error 837 occurs when the Windows operating system reports an I/O failure back to SQL Server 2025 during a read or write operation at a specific byte offset within a database file. This is most commonly triggered when the underlying storage is remote (SAN, NAS, SMB file share, or cloud-attached storage like Azure Files) and the I/O request exceeds the configured timeout threshold before the storage layer responds. Root causes typically include network latency/packet loss between the host and remote storage, an overloaded storage array, misconfigured multipath I/O (MPIO) drivers, or insufficient timeout values set at the HBA/driver or OS level for high-latency remote connections.

Step-by-Step Resolution Guide

Step 1: Verify Remote Storage Connectivity and Latency

  • Check the physical/virtual network path between the SQL Server host and the remote storage target (iSCSI, SMB share, or SAN).
  • Run Test-NetConnection -ComputerName <StorageHostName> -Port 445 (for SMB) or the relevant iSCSI port to confirm no packet loss or latency spikes.
  • Review Windows Event Viewer under Windows Logs > System for related Disk, iScsiPrt, or MsFcib warnings around the same timestamp as Error 837.

Step 2: Increase OS and Driver-Level I/O Timeout Values

  • Open Registry Editor and navigate to:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk
  • Modify (or create) the TimeOutValue DWORD and increase it from the default (usually 10) to 60 seconds to accommodate remote I/O latency.
  • If using iSCSI, also update the timeout under:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E97B-E325-11CE-BFC1-08002BE10318}\<Instance_ID>\Parameters
  • Restart the server for the registry changes to take effect.

Step 3: Validate Multipath I/O (MPIO) and HBA Driver Configuration

  • Open Server Manager > Tools > MPIO and confirm the correct load-balancing policy (e.g., Round Robin or Failover Only) is applied for your storage vendor.
  • Update HBA/NIC firmware and drivers to the latest version certified for Windows Server 2025 from the storage vendor’s support site.
  • Ensure Jumbo Frames (if applicable) are consistently enabled end-to-end on both the NIC and the physical switch to prevent fragmentation-related delays.

Step 4: Run SQL Server Integrity Checks on Affected Database

  • Once connectivity is stable, run the following against the database referenced in the error log:
DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for any corruption that may have resulted from the interrupted I/O and address per the repair recommendations if found.

Alternative or Verification Steps

  • Monitor the SQL Server Error Log and Windows System Event Log for 24-48 hours post-fix to confirm Error 837 no longer appears during peak I/O load.
  • If the issue persists, temporarily move the database files to local/direct-attached storage to isolate whether the fault lies with the remote storage infrastructure rather than SQL Server itself.

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

Troubleshooting Guide: SQL Server Error 832 — “A Page That Should Have Been Constant Has Changed”

Why This Error Happens

Error 832 occurs when SQL Server’s checksum validation detects that a data page in memory does not match its expected checksum, despite the page not being flagged as modified. This is almost always caused by faulty hardware (RAM, disk controller, or storage subsystem) silently corrupting data in the buffer pool, or by a bug in storage drivers/firmware on Windows Server 2025. In rare cases, it can also stem from antivirus or backup software directly touching the database files while SQL Server has them memory-mapped.

Step-by-Step Resolution Guide

Step 1: Run Immediate Database Integrity Checks

  • Open SQL Server Management Studio (SSMS) or sqlcmd and execute: DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review output for additional consistency errors (823, 824) that may indicate broader corruption.
  • Document the specific page ID and file referenced in the error log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG).

Step 2: Validate Underlying Hardware and Storage

  • Run Windows Memory Diagnostic (mdsched.exe) to rule out faulty RAM.
  • Check Event Viewer under Windows Logs > System for Disk or Storport errors correlating with the SQL error timestamp.
  • Validate storage health using Get-PhysicalDisk | Get-StorageReliabilityCounter in PowerShell to check for read/write errors on the volume hosting the .mdf/.ldf files.
  • Update storage controller drivers and firmware via Windows Update or vendor tools (e.g., Dell OMSA, HPE iLO).

Step 3: Exclude SQL Server Files from Antivirus and Backup Agents

  • Navigate to your antivirus console and exclude the SQL Server data directory, typically: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\
  • Exclude file extensions .mdf, .ldf, .ndf from real-time scanning.
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER to clear any corrupted buffer pool pages.

Step 4: Restore From a Clean Backup (If Corruption Persists)

  • If DBCC CHECKDB confirms corruption, restore the affected database from the last known good backup using: RESTORE DATABASE YourDatabaseName FROM DISK = 'D:\Backups\YourDatabaseName.bak' WITH REPLACE;
  • Apply transaction log backups if using full recovery model to minimize data loss.

Alternative or Verification Steps

  • After remediation, re-run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS; and confirm zero allocation or consistency errors are returned.
  • If errors persist despite clean hardware and backups, enable Page Verification = CHECKSUM (ALTER DATABASE YourDatabaseName SET PAGE_VERIFY CHECKSUM;) and monitor the SQL Server error log for recurrence over 24–48 hours to isolate transient vs. persistent hardware faults.

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

Troubleshooting Guide: SQL Server Error 833 – Long I/O Request Warnings

Why This Error Happens

Error 833 is raised when the SQL Server I/O subsystem detects that a read or write request to a database file has taken longer than 15 seconds to complete, indicating the underlying storage layer cannot keep pace with SQL Server’s I/O demands. This is typically caused by overloaded or failing storage hardware, misconfigured SAN/NAS paths, outdated or faulty storage drivers, antivirus/filter drivers intercepting file I/O, or resource contention from other workloads sharing the same disk subsystem. It is a warning rather than a corruption error, but sustained occurrences often precede timeouts, blocking, or actual data corruption if left unresolved.

Step-by-Step Resolution Guide

Step 1: Identify the Affected File and Storage Path

  • Check the error message for the file path referenced by the OS file handle (0x%p) and cross-reference it in sys.master_files using the database id provided.
  • Run the following query to map the file to its physical location:
  SELECT database_id, file_id, physical_name, type_desc 
  FROM sys.master_files 
  WHERE database_id = <db_id_from_error>;
  • Confirm whether the file resides on local disk, SAN, NAS, or a cloud-attached volume (e.g., Azure Disk, iSCSI).

Step 2: Review Windows Storage and Event Logs

  • Open Event Viewer on Windows Server 2025 / Windows 11 and navigate to Windows Logs > System.
  • Filter for Event IDs 153, 129, or 51, which indicate disk-level timeouts or controller resets correlating with SQL’s Error 833.
  • Check Applications and Services Logs > Microsoft > Windows > Storage for Storport or disk driver warnings.
  • If using a SAN, review multipathing (MPIO) logs via mpiocpl.exe or the vendor’s DSM management console.

Step 3: Update Storage Drivers and Firmware

  • Navigate to Device Manager > Disk Drives / Storage Controllers and check driver versions against the storage vendor’s latest release (e.g., Dell PERC, HPE Smart Array, or NVMe controller drivers).
  • Apply any pending firmware updates to HBAs, RAID controllers, or SSD/NVMe drives via the manufacturer’s update utility.
  • Reboot the host after driver/firmware updates to ensure the storage stack reinitializes cleanly.

Step 4: Exclude SQL Server Files from Antivirus and Filter Drivers

  • Open your antivirus/EDR console and add exclusions for:
  • *.mdf, *.ldf, *.ndf database files
  • The SQL Server installation directory (default: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA)
  • sqlservr.exe process itself
  • Restart the SQL Server (MSSQLSERVER) service via services.msc to apply the exclusions cleanly.

Step 5: Offload or Rebalance I/O Workload

  • Use Performance Monitor (PerfMon) to track the Avg. Disk sec/Read and Avg. Disk sec/Write counters on the affected volume; values consistently above 20ms indicate a bottleneck.
  • If the disk is shared with other VMs or workloads (common in Hyper-V/VMware environments), migrate the SQL data/log files to a dedicated, higher-IOPS volume.
  • Consider separating data and log files onto different physical drives to reduce contention.

Alternative or Verification Steps

  • After applying fixes, monitor the SQL Server error log and Windows Event Viewer for 24–48 hours to confirm Error 833 no longer recurs; run DBCC CHECKDB on the affected database to rule out any resulting corruption.
  • If long I/O persists despite hardware/driver updates, engage your storage vendor to run a full SAN/NAS latency diagnostic, as the bottleneck may originate outside the Windows host (e.g., fabric switch congestion or array-side queue saturation).

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

Troubleshooting Guide: SQL Server Error 835 – Failed Creating Event for Sparse File Operation

Why This Error Happens

Error 835 occurs when SQL Server 2025 attempts to create a Windows event object associated with a sparse file operation (commonly tied to database snapshots or Hekaton/In-Memory OLTP checkpoint files) but the underlying operating system call fails. This is typically caused by insufficient system resources (handle or kernel object exhaustion), restrictive security/group policy settings on the SQL Server service account, or the target file path residing on a volume with filesystem-level corruption or incompatible configuration (such as a non-NTFS/ReFS volume or a volume with sparse file support disabled). In rare cases, this is also triggered by antivirus or EDR software intercepting and blocking low-level event handle creation on the file.

Step-by-Step Resolution Guide

Step 1: Verify the SQL Server Service Account Permissions

  • Open Services.msc and confirm which account runs the SQL Server (MSSQLSERVER) service.
  • Ensure this account has Full Control NTFS permissions on the data/log directory and the directory referenced in the error message (check the %ls file path in the full error text).
  • Confirm the account has the “Create global objects” user right via secpol.msc → Local Policies → User Rights Assignment.
  • Restart the SQL Server service after any permission changes:
  net stop MSSQLSERVER && net start MSSQLSERVER

Step 2: Check System Resource and Kernel Handle Limits

  • Open Performance Monitor (perfmon.exe) and monitor the Process > Handle Count counter for sqlservr.exe.
  • Check Windows Event Viewer under System and Application logs for correlating Kernel-Event-Tracing or resource exhaustion warnings at the same timestamp as Error 835.
  • If handle counts are abnormally high, identify runaway sessions or snapshot files using:
  SELECT * FROM sys.dm_os_memory_objects WHERE type = 'MEMOBJ_SOSOS';
  • Increase available system resources or reboot the Windows Server 2025 host if exhaustion is confirmed.

Step 3: Validate the File System and Sparse File Support

  • Confirm the volume hosting the file in the error message is formatted as NTFS or ReFS (sparse files are not supported on FAT32/exFAT).
  • Run chkdsk against the affected volume to rule out corruption:
  chkdsk D: /f /r
  • If the file resides on a database snapshot sparse file (.ss file), drop and recreate the snapshot:
  DROP DATABASE [Snapshot_Name];

Step 4: Exclude SQL Server Directories from Antivirus/EDR Scanning

  • Add exclusions in Windows Defender or third-party antivirus for:
  • SQL Server data/log directories (e.g., C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\)
  • The sqlservr.exe process itself
  • Use PowerShell to add a Defender exclusion:
  Add-MpPreference -ExclusionPath "C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA"

Step 5: Apply the Latest Cumulative Update for SQL Server 2025

  • Check the currently installed build version:
  SELECT @@VERSION;
  • Download and install the latest Cumulative Update (CU) from the Microsoft Update Catalog, as this error has known fixes related to sparse file event handling in early SQL Server 2025 builds.
  • Reboot the server after patching to ensure kernel-level drivers are refreshed.

Alternative or Verification Steps

  • After applying fixes, re-run the operation that triggered Error 835 (e.g., snapshot creation or In-Memory OLTP checkpoint) and monitor the SQL Server Error Log (ERRORLOG) for recurrence.
  • If the error persists, run SQLIOSim or DBCC CHECKDB against the affected database to rule out deeper I/O subsystem or corruption issues, and review the Windows System Event Log for matching disk or kernel-level error codes (e.g., Event ID 7 or 153).

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

Troubleshooting Guide: SQL Server Error 830 – Stale Page Read

Why This Error Happens

Error 830 occurs when SQL Server reads a data page from storage and detects that the page’s Log Sequence Number (LSN) is older than the LSN already recorded as the last write for that page in memory. This typically indicates that the underlying storage subsystem (SAN, NAS, or virtual disk layer) has lost or misdirected a write, often due to a caching controller returning a stale cached copy instead of the actual on-disk version. It is a strong indicator of an unstable I/O path, faulty storage drivers, or a SAN replication/snapshot mechanism that is not honoring forced unit access (FUA) and write-through flags required by SQL Server.

Step-by-Step Resolution Guide

Step 1: Run Immediate Data Integrity Checks

  • Open SQL Server Management Studio (SSMS) or sqlcmd and run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; against the affected database.
  • Review the SQL Server Error Log (located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG on default Windows Server 2025 installs) for the exact Page ID and File ID referenced alongside the 830 error.
  • Note the timestamp of the error to correlate with storage or SAN logs in Event Viewer under Windows Logs > System.

Step 2: Validate the Storage and I/O Subsystem

  • Run sqlmin.exe -T3624 diagnostic trace or use SQLIOSim.exe to stress-test the I/O path and confirm write-order fidelity on the volume hosting your .mdf/.ldf files.
  • Check Windows Server 2025 Disk Management and Device Manager for outdated storage controller or HBA (Host Bus Adapter) drivers; update them via the OEM vendor site rather than Windows Update.
  • If running on a VM (Hyper-V or VMware), verify that disk caching policy is set to “No Caching” or “Write-Through” in the hypervisor’s virtual disk settings, not “Write-Back.”
  • Confirm any SAN-level snapshot, replication, or deduplication features are configured with write-order consistency groups enabled.

Step 3: Restore the Affected Page or Database

  • If DBCC CHECKDB confirms corruption, restore the specific page using: RESTORE DATABASE YourDatabaseName PAGE='1:12345' FROM DISK='D:\Backups\YourDB.bak' WITH NORECOVERY; followed by applying transaction log backups.
  • If page-level restore is not possible, perform a full database restore from the last known good backup taken before the Error 830 timestamp.
  • Ensure WITH CHECKSUM is enabled on all future backups via: BACKUP DATABASE YourDatabaseName TO DISK='D:\Backups\YourDB.bak' WITH CHECKSUM, COMPRESSION;

Step 4: Enable Page Checksum and Harden I/O Settings

  • Verify PAGE_VERIFY is set to CHECKSUM by running: ALTER DATABASE YourDatabaseName SET PAGE_VERIFY CHECKSUM;
  • On the Windows Server 2025 host, disable any third-party disk write-caching utilities that do not support SQL Server’s I/O requirements.
  • Review the storage vendor’s SQL Server compatibility matrix to confirm the firmware and multipathing software (e.g., MPIO) versions are certified.

Alternative or Verification Steps

  • After remediation, re-run DBCC CHECKDB with ALL_ERRORMSGS and monitor the SQL Server Error Log for 24-48 hours to confirm Error 830 does not recur during peak I/O load.
  • As an alternative, if the stale page issue persists despite driver and firmware updates, migrate the database files to a different physical volume or storage array temporarily to isolate whether the fault is specific to the original disk subsystem.

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

Troubleshooting Guide: SQL Server Error 831 – “Unable to Deallocate a Kept Page”

Why This Error Happens

This error occurs when SQL Server’s buffer pool manager cannot release a page from memory because its internal “kept” reference count is stuck above zero, often due to a stalled or orphaned internal process holding a latch on that page. This is frequently triggered by buffer pool corruption, faulty storage drivers, or memory pressure interacting with antivirus/filter drivers that intercept I/O operations. In rarer cases, it stems from a genuine hardware-level memory corruption event affecting the SQL Server process space.

Step-by-Step Resolution Guide

Step 1: Restart the SQL Server Service to Clear the Buffer Pool

  • Open SQL Server Configuration Manager on Windows Server 2025 / Windows 11.
  • Right-click the SQL Server (MSSQLSERVER) instance and select Restart.
  • This clears the in-memory buffer pool, releasing any pages stuck in a “kept” state.
  • Note: This is a short-term fix; the root cause must still be addressed.

Step 2: Run DBCC CHECKDB to Identify Underlying Corruption

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Execute the following against the database referenced in the error (replace %d with the actual database ID found via SELECT DB_NAME(%d)):
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review results for allocation or consistency errors that may correlate with Error 831.
  • If corruption is found, note the recommended repair level (e.g., REPAIR_REBUILD) before proceeding.

Step 3: Exclude SQL Server Files from Antivirus/Filter Driver Scanning

  • Navigate to Windows Security settings or your third-party antivirus console.
  • Add exclusions for the following paths:
  • C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\
  • C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\
  • Exclude the sqlservr.exe process explicitly from real-time scanning.
  • Restart the SQL Server service after applying exclusions.

Step 4: Update Storage and Memory-Related Drivers

  • Check Device Manager on Windows Server 2025 for outdated storage controller (RAID/SAN/HBA) or NIC drivers.
  • Download and install the latest certified drivers from the hardware vendor (e.g., Dell, HPE, Broadcom).
  • Reboot the server to apply driver updates fully before restarting SQL Server services.

Step 5: Apply the Latest SQL Server 2025 Cumulative Update

  • Visit the Microsoft Update Catalog or use SQL Server Setup to check for the latest Cumulative Update (CU) for SQL Server 2025.
  • Install the CU in a maintenance window, as it may include buffer pool management fixes.
  • Restart the SQL Server instance after installation completes.

Alternative or Verification Steps

  • Re-run DBCC CHECKDB on the affected database after applying fixes — a clean result with zero allocation errors confirms resolution.
  • If Error 831 recurs immediately after a service restart, run Windows Memory Diagnostic (mdsched.exe) to rule out physical RAM corruption as the root cause.

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

Troubleshooting Guide: SQL Server Error 826 – Incorrect PageID

Why This Error Happens

Error 826 occurs when SQL Server reads a page from disk and discovers that the page header’s identifier does not match the location it was read from, indicating the data file has been corrupted at the storage layer. This is typically caused by a faulty I/O subsystem, a misbehaving disk controller/driver, or a storage virtualization layer silently misdirecting writes. Unlike checksum errors, this specific mismatch usually points to the underlying hardware, SAN fabric, or filter driver (such as antivirus or backup software) tearing or misplacing pages during write operations rather than a logical corruption within SQL Server itself.

Step-by-Step Resolution Guide

Step 1: Isolate the Affected Database and Run Integrity Checks

  • Run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to confirm the scope of corruption.
  • Note the specific file ID and page ID reported in the error (e.g., 1:4521) from the SQL Server Error Log located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG.
  • Cross-reference the timestamp of the error with any recent storage maintenance, driver updates, or VM snapshot operations on Windows Server 2025.

Step 2: Check Windows Event Viewer and Storage Health

  • Open Event Viewer and navigate to Windows Logs > System, filtering for Event IDs 7, 11, 15, 51, or 153, which indicate disk or controller-level faults.
  • On Windows 11/Server 2025, run Get-PhysicalDisk | Get-StorageReliabilityCounter in PowerShell to check for read/write errors or latency spikes on the underlying volume.
  • If using a SAN or virtualized disk (Hyper-V/VMware), verify the storage controller firmware and drivers are updated to the latest stable version, not just the newest release.

Step 3: Disable Interfering Filter Drivers and Exclude SQL Paths

  • Confirm that antivirus or endpoint protection software is excluding SQL Server data/log directories (commonly D:\SQLData\ and D:\SQLLogs\).
  • Temporarily disable third-party backup agents or replication filter drivers that hook into the storage stack, as these are known to cause page misalignment during high I/O.
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER after making exclusion changes to ensure a clean I/O handle re-initialization.

Step 4: Restore From a Clean Backup if Corruption Persists

  • If DBCC CHECKDB confirms the page is unrecoverable via repair, restore the specific damaged page using RESTORE DATABASE YourDatabaseName PAGE='1:4521' FROM DISK = 'D:\Backups\YourDatabase.bak' WITH NORECOVERY; followed by a transaction log restore.
  • As a last resort, run DBCC CHECKDB ('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) only after taking a full backup of the current (corrupted) state, understanding this may discard the damaged page’s data.

Alternative or Verification Steps

  • After remediation, re-run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS; and confirm zero allocation or consistency errors are returned.
  • If Error 826 recurs on different page IDs across multiple runs, treat it as a hardware-level issue and escalate to the storage vendor rather than continuing SQL-level repairs, as this pattern indicates the underlying disk is failing.

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

Troubleshooting Guide: SQL Server Error 829 – “Database ID %d”

Why This Error Happens

Error 829 occurs when SQL Server 2025 marks one or more pages in a database as “suspect” due to detecting logical or structural corruption during a read operation, often triggered by a previous I/O error, improper shutdown, or storage-level fault. This typically happens when the underlying disk subsystem, SAN, or virtualization layer returns inconsistent data, or when SQL Server’s checksum validation fails on page read. In Windows Server 2025 environments, this can also stem from file system corruption (NTFS/ReFS) or antivirus/backup software interfering with database file locks.

Step-by-Step Resolution Guide

Step 1: Identify the Suspect Pages and Affected Database

  • Run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS to get a full corruption report.
  • Query the msdb.dbo.suspect_pages table to list exact page IDs and file IDs flagged as suspect.
  • Check the SQL Server error log (default path: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the specific LSN and page number tied to Error 829.

Step 2: Isolate and Rule Out Storage/Hardware Faults

  • Open Windows Event Viewer (eventvwr.msc) and check the System log for Disk, ntfs, or storport warnings correlating with the SQL Server error timestamp.
  • Run chkdsk D:\ /f /r (replace D:\ with your actual data drive) in an elevated Command Prompt to scan and repair file system-level corruption.
  • If running on a VM, verify the virtual disk/SAN LUN health using your hypervisor’s diagnostic tools (e.g., Hyper-V Manager or VMware vSphere Client).

Step 3: Restore from a Clean Backup (Preferred Method)

  • Take a tail-log backup if the database is still online: BACKUP LOG YourDatabaseName TO DISK = 'C:\Backups\YourDatabase_tail.trn'.
  • Restore the last known-good full backup along with subsequent differential/log backups using SQL Server Management Studio (SSMS) or T-SQL RESTORE DATABASE commands.
  • Ensure the restore sequence brings the database to a point before the corruption was introduced.

Step 4: Run Emergency Repair if No Backup Is Available

  • Set the database to single-user emergency mode: ALTER DATABASE YourDatabaseName SET EMERGENCY.
  • Execute DBCC CHECKDB ('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS — note this may delete corrupted rows/pages permanently.
  • Return the database to multi-user mode: ALTER DATABASE YourDatabaseName SET MULTI_USER.

Step 5: Harden Configuration to Prevent Recurrence

  • Enable PAGE_VERIFY CHECKSUM on the database via ALTER DATABASE YourDatabaseName SET PAGE_VERIFY CHECKSUM.
  • Exclude the SQL Server data/log file directories (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA) from antivirus real-time scanning and Windows Server backup locking conflicts.

Alternative or Verification Steps

  • After remediation, re-run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS and confirm zero allocation or consistency errors are returned.
  • If corruption persists after storage checks and restore attempts, engage Microsoft Premier Support with the ERRORLOG and SELECT * FROM msdb.dbo.suspect_pages output, as this may indicate a deeper SAN firmware or storport driver issue requiring vendor escalation.

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

Troubleshooting Guide: SQL Server Error 823

Why This Error Happens

Error 823 occurs when SQL Server’s I/O requests fail at the operating system level, typically due to underlying disk hardware faults, corrupted file system structures, or failing storage controllers/drivers. This can also be triggered by antivirus software locking database files during read/write operations, or by using unsupported storage configurations (such as network shares without proper SMB 3.0 support) for database files. In rare cases, memory corruption or a mismatched sector size between the storage device and SQL Server’s I/O subsystem can also produce this error.

Step-by-Step Resolution Guide

Step 1: Check the Windows Event Logs for Hardware Faults

  • Open Event Viewer and navigate to Windows Logs > System.
  • Look for correlating Disk, Ntfs, or Volmgr warnings/errors around the same timestamp as the SQL Error 823.
  • Run chkdsk C: /f /r (replace C: with the actual drive hosting the .mdf/.ldf files) during a scheduled maintenance window to scan for file system corruption.

Step 2: Run DBCC CHECKDB to Assess Database Integrity

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Execute the following command against the impacted database:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for consistency errors; if corruption is found, plan for a restore from a known-good backup rather than relying solely on repair options.

Step 3: Exclude SQL Server Files from Antivirus Scanning

  • Open Windows Security or your third-party antivirus console.
  • Add exclusions for the following paths (adjust to your actual instance paths):
  • C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\
  • C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\
  • Restart the SQL Server (MSSQLSERVER) service via services.msc to apply changes.

Step 4: Verify Storage Controller Drivers and Firmware

  • Open Device Manager and check the Storage Controllers node for driver warnings.
  • Update RAID/HBA controller drivers and firmware to the latest vendor-certified versions for Windows Server 2025.
  • If using virtualized storage (Hyper-V, SAN, or cloud-attached disks), confirm the storage backend supports 4K/512e sector alignment matching SQL Server’s I/O requirements.

Step 5: Restore from Backup if Corruption Is Confirmed

  • If DBCC CHECKDB confirms unrecoverable corruption, restore the database from the most recent full backup plus transaction log backups:
  RESTORE DATABASE [YourDatabaseName] FROM DISK = 'E:\Backups\YourDatabaseName.bak' WITH RECOVERY;
  • Ensure backups are stored on separate physical storage from production data files to avoid repeat exposure to the same hardware fault.

Alternative or Verification Steps

  • After applying fixes, run DBCC CHECKDB again and monitor the SQL Server Error Log (via EXEC sp_readerrorlog; or SSMS’s Logs viewer) for 24–48 hours to confirm Error 823 does not recur.
  • If the issue persists despite clean CHECKDB results and updated drivers, run the vendor-specific disk diagnostic utility (e.g., manufacturer’s SMART tool) to rule out a failing physical drive, and consider migrating the database files to a different volume as a temporary workaround.

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

Troubleshooting Guide: SQL Server Error 824 – Logical Consistency-Based I/O Error

Why This Error Happens

Error 824 occurs when SQL Server reads a page from disk and detects that the data does not match what it expects, indicating a logical consistency failure such as a torn page, checksum mismatch, or bad page ID. This is typically caused by underlying storage subsystem corruption, faulty disk controllers, SAN/NAS firmware bugs, or memory/driver issues that silently corrupt data between the OS and the physical disk. In virtualized environments (Hyper-V on Windows Server 2025), it can also stem from misconfigured storage filters, antivirus scanning database files, or improper VM snapshot handling of VHDX files.

Step-by-Step Resolution Guide

Step 1: Identify the Scope of Corruption

  • Open the SQL Server Error Log via SSMS or %ProgramFiles%\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG and locate the full 824 message, noting the database ID, file name, and page ID.
  • Run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS to get a complete list of affected objects and corruption severity.
  • Cross-reference the page offset reported in the error with DBCC PAGE to determine if it’s a data, index, or system page.

Step 2: Check the Underlying Storage Hardware

  • Open Windows Event Viewer (eventvwr.msc) and inspect the System log for Disk, ntfs, or storahci warnings/errors around the same timestamp as the SQL error.
  • Run chkdsk X: /f /r on the volume hosting the .mdf/.ldf files (requires a reboot if it’s the OS/data drive) to scan for physical disk inconsistencies.
  • If running on a SAN or Storage Spaces Direct (S2D) cluster, check the storage vendor’s diagnostic tool or Get-PhysicalDisk | Get-StorageReliabilityCounter in PowerShell for predictive failure indicators.
  • Verify firmware and driver versions for the HBA/RAID controller are current via Windows Update or OEM support site.

Step 3: Exclude SQL Server Files from Antivirus and Backup Agents

  • Navigate to Windows Security > Virus & threat protection > Manage settings > Add or remove exclusions.
  • Add exclusions for the full SQL Server data directory (e.g., D:\SQLData\), log directory (e.g., L:\SQLLogs\), and TempDB path.
  • Ensure third-party backup software (e.g., VEEAM, Commvault) is configured to use SQL Server VSS writer correctly and does not lock or scan live .mdf/.ndf/.ldf files during snapshots.

Step 4: Restore or Repair the Affected Database

  • If a clean, recent backup exists, restore the database using RESTORE DATABASE YourDB FROM DISK = 'E:\Backups\YourDB.bak' WITH REPLACE.
  • If no backup is available, run DBCC CHECKDB ('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) as a last resort, understanding this may delete corrupted rows to restore logical consistency.
  • Always run the repair in SINGLE_USER mode first: ALTER DATABASE YourDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE.

Step 5: Enable Proactive Monitoring to Prevent Recurrence

  • Enable Page Verify CHECKSUM on the database: ALTER DATABASE YourDB SET PAGE_VERIFY CHECKSUM.
  • Schedule a recurring SQL Agent job to run DBCC CHECKDB weekly during low-traffic windows.
  • Configure Windows Server 2025’s Storage Health Monitoring (via Windows Admin Center) to send alerts on disk-level failures proactively.

Alternative or Verification Steps

  • After remediation, re-run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS and confirm it returns 0 allocation errors and 0 consistency errors.
  • If corruption recurs on the same LUN/volume after hardware checks pass, consider migrating the database files to a different physical disk or storage array to rule out a persistent hardware fault.

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

Troubleshooting Guide: SQL Server Error 825 (Read-Retry Warning)

Why This Error Happens

Error 825 is raised when SQL Server 2025 encounters an intermittent I/O failure while reading a page from a database file, but the operation ultimately succeeds after one or more retries. This typically points to underlying storage subsystem instability, such as a failing disk, a flaky SAN/NAS connection, outdated storage drivers, or antivirus/filter-driver interference on Windows Server 2025 or Windows 11. Although the read eventually succeeded, the recurrence of this error signals that the physical storage layer is unreliable and database pages may be at risk of corruption.

Step-by-Step Resolution Guide

Step 1: Review SQL Server and Windows Event Logs

  • Open SQL Server Management Studio (SSMS) and check the SQL Server Error Log for the exact file name and offset reported in the Error 825 message.
  • Open Event Viewer (eventvwr.msc) and inspect the System and Application logs under Windows Logs for correlating Disk, Storport, or iScsiPrt warnings/errors around the same timestamp.
  • Note the disk or LUN identifier tied to the affected .mdf/.ndf/.ldf file path (e.g., D:\SQLData\MyDB.mdf).

Step 2: Run a Full Consistency Check on the Database

  • Open a query window in SSMS and execute: DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for any allocation or consistency errors beyond the I/O warning.
  • If corruption is confirmed, restore from the most recent known-good backup using RESTORE DATABASE rather than attempting in-place repair.

Step 3: Validate and Update Storage Drivers/Firmware

  • Open Device Manager (devmgmt.msc) and update the Storage Controller driver (SAS/RAID/HBA) to the latest vendor-certified version for Windows Server 2025.
  • For SAN-attached storage, confirm multipathing (MPIO) is correctly configured via mpclaim.exe -s -d.
  • Check firmware versions on physical disks/controllers against the vendor’s compatibility matrix for Windows Server 2025.

Step 4: Exclude SQL Server Files from Antivirus/Filter Drivers

  • Navigate to your antivirus console and add exclusions for the SQL Server data directories (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).
  • Exclude file extensions .mdf, .ndf, .ldf, and .bak from real-time scanning.
  • Restart the SQL Server service via services.msc or NET STOP MSSQLSERVER && NET START MSSQLSERVER to apply exclusions cleanly.

Step 5: Enable Enhanced I/O Logging for Monitoring

  • Enable SQL Server’s -T3605 trace flag temporarily (via SQL Server Configuration Manager startup parameters) to capture extended I/O diagnostics in the error log.
  • Monitor Performance Monitor (perfmon.exe) counters under PhysicalDisk > Avg. Disk sec/Read and Avg. Disk sec/Write for latency spikes above 15-20ms, indicating a failing drive.

Alternative or Verification Steps

  • Run DBCC CHECKDB again after 24-48 hours of monitoring to confirm no new consistency errors have appeared, and check the SQL error log to ensure Error 825 has not recurred.
  • If the error persists despite driver updates and exclusions, engage your storage vendor to run hardware-level diagnostics (e.g., chkdsk /f /r on the volume or vendor-specific disk health utilities) and consider migrating the database files to a different physical disk/LUN as a failover test.

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

Troubleshooting Guide: SQL Server Error 821 – Buffer Unhash Failure

Why This Error Happens

Error 821 occurs when the SQL Server Database Engine attempts to unhash a buffer page from the buffer pool hash table, but the page cannot be located despite its HASHED status flag being set. This typically indicates buffer pool corruption caused by faulty memory (RAM), a corrupted database page cache, or an internal inconsistency triggered by abrupt I/O interruptions or storage subsystem failures. In most cases, this is a symptom of underlying hardware instability rather than a pure software bug.

Step-by-Step Resolution Guide

Step 1: Run Hardware Memory Diagnostics

  • Open Windows Memory Diagnostic Tool on Windows Server 2025 / Windows 11 by running mdsched.exe.
  • Reboot the server and allow the tool to complete a full RAM scan before SQL Server services restart.
  • If errors are found, replace the faulty DIMM module(s) identified by the diagnostic report.

Step 2: Check Storage Subsystem Integrity

  • Run chkdsk C: /f /r (replace C: with your SQL data drive letter) in an elevated Command Prompt.
  • Review the Windows Event Viewer under Windows Logs > System for Disk or NTFS-related warnings around the time Error 821 occurred.
  • Verify your SAN/RAID controller firmware and drivers are updated to the latest vendor-supported version.

Step 3: Validate Database Consistency

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to detect corruption in the affected database.
  • If corruption is confirmed, restore the database from the last known good backup rather than attempting repair options that may cause data loss.

Step 4: Review SQL Server Error Logs and Minidumps

  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\LOG\ to locate the ERRORLOG file and any generated .mdmp dump files.
  • Cross-reference the timestamp of Error 821 with any concurrent I/O or memory-related entries logged by the OS.
  • If the issue recurs, package the logs and dump files for submission to Microsoft Technical Support as recommended by the error message.

Step 5: Apply Latest SQL Server Cumulative Update

  • Check the installed build version using SELECT @@VERSION; in a query window.
  • Download and apply the latest Cumulative Update (CU) for SQL Server 2025 from the Microsoft Update Catalog.
  • Restart the SQL Server service via services.msc after installation completes.

Alternative or Verification Steps

  • After applying fixes, run DBCC CHECKDB again on all user databases to confirm no HASHED buffer or allocation errors remain.
  • If Error 821 persists after hardware and consistency checks, failover to a secondary replica (if using Always On Availability Groups) and rebuild the primary node from scratch to rule out persistent host-level corruption.

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

Troubleshooting Guide: SQL Server Error 822 – I/O Operation Could Not Start

Why This Error Happens

Error 822 occurs when SQL Server 2025 cannot initiate a read or write request against a database file, typically because the underlying storage subsystem returned an unexpected response or became temporarily unavailable. This is most commonly caused by filter drivers (antivirus, backup software) intercepting I/O calls, disk/storage controller timeouts, or corrupted file system metadata on the volume hosting the .mdf/.ldf files. In virtualized or cloud-hosted environments, this can also stem from storage latency exceeding SQL Server’s I/O wait thresholds.

Step-by-Step Resolution Guide

Step 1: Check Windows Event Viewer and SQL Error Log for Storage Clues

  • Open Event Viewer > Windows Logs > System and filter for Disk, Ntfs, or volsnap warnings/errors around the same timestamp.
  • Review ERRORLOG located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for correlating I/O warnings (e.g., “SQL Server has encountered X occurrence(s) of I/O requests taking longer than 15 seconds”).
  • Identify which %S_BLKIOPTR file or disk is referenced to narrow down the affected storage volume.

Step 2: Exclude SQL Server Files from Antivirus/Filter Drivers

  • Add exclusions in your antivirus console for:
  • *.mdf, *.ldf, *.ndf database files
  • The MSSQL\Data and MSSQL\Log directories
  • SQL Server executable processes (sqlservr.exe)
  • Run fltmc in an elevated Command Prompt to list active filter drivers and temporarily unload suspicious third-party filters for testing:
  fltmc unload <FilterName>

Step 3: Validate Disk Health and File System Integrity

  • Run chkdsk <Drive>: /f /r on the volume hosting the SQL data/log files (requires a reboot if the volume is in use).
  • Check the physical/virtual disk controller firmware and drivers are up to date via Device Manager or vendor tools.
  • If using SAN/NAS storage, confirm multipathing (MPIO) is configured correctly and there are no failed paths.

Step 4: Run DBCC CHECKDB to Rule Out Corruption

  • Execute the following in SQL Server Management Studio (SSMS):
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is confirmed, restore from the most recent clean backup rather than attempting repair options that may cause data loss.

Step 5: Adjust SQL Server I/O Timeout and Affinity Settings

  • Open SQL Server Configuration Manager, verify the service account has full control permissions on the data/log directories.
  • Review HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Disk\TimeOutValue in the registry and increase if storage latency is confirmed (default is 60 seconds; adjust in consultation with your storage vendor).
  • Restart the SQL Server service after changes:
  net stop MSSQLSERVER && net start MSSQLSERVER

Alternative or Verification Steps

  • Run DBCC CHECKDB again post-fix and confirm zero allocation/consistency errors; monitor the SQL Error Log for 24–48 hours to ensure Error 822 does not recur.
  • If the issue persists, fail over to a secondary replica (if using Always On Availability Groups) and perform a full storage subsystem diagnostic (e.g., Diskspd or vendor-specific SAN health check) before bringing the primary back online.

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

Troubleshooting Guide: SQL Server Error 808 – “Insufficient Bytes Transferred”

Why This Error Happens

Error 808 occurs when SQL Server 2025 detects a mismatch between the number of bytes requested during an I/O operation (typically during backup or restore) and the number of bytes actually returned by the underlying storage subsystem. This is frequently caused by a faulty or outdated storage driver, a misconfigured backup device (such as a network share or VDI-based third-party backup tool), or an antivirus/filter driver intercepting and corrupting the I/O stream. In rarer cases, it stems from hardware-level issues like a failing disk controller or unstable SAN/NAS connectivity on Windows Server 2025.

Step-by-Step Resolution Guide

Step 1: Verify the Backup Target and Device Health

  • Confirm the backup destination (local disk, UNC path, or cloud storage) is online and has sufficient free space.
  • If backing up to a network share, test connectivity using Test-Path \\ServerName\ShareName in PowerShell.
  • Check Windows Event Viewer under Windows Logs > System for disk or NTFS-related warnings (Event ID 7, 11, or 51).

Step 2: Update Storage and HBA/RAID Controller Drivers

  • Open Device Manager on Windows Server 2025 and locate the storage controller under “Storage controllers.”
  • Right-click and select Update driver, or manually download the latest driver from the hardware vendor (Dell, HPE, Broadcom, etc.).
  • Reboot the server after the update and re-run the failed backup/restore job.

Step 3: Exclude SQL Server Files from Antivirus and Filter Drivers

  • Add exclusions in Windows Defender (or third-party AV) for:
  • C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\
  • C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\
  • Run fltmc filters in an elevated Command Prompt to list active filter drivers and identify any third-party VSS or backup agent interfering with I/O.
  • Temporarily disable third-party backup agents (e.g., Veeam, Commvault) and attempt a native BACKUP DATABASE command to isolate the issue.

Step 4: Run a Native Backup with CHECKSUM to Validate I/O Integrity

  • Execute the following T-SQL command to force validation during backup:
  BACKUP DATABASE [YourDB] 
  TO DISK = 'D:\Backups\YourDB.bak' 
  WITH CHECKSUM, STATS = 10;
  • If the backup fails with the same Error 808, this confirms a hardware or driver-level I/O corruption rather than a SQL Server configuration issue.

Step 5: Run DBCC CHECKDB to Rule Out Database Corruption

  • Execute DBCC CHECKDB('YourDB') WITH NO_INFOMSGS, ALL_ERRORMSGS; to ensure the database pages themselves are not corrupted.
  • Review the output for allocation or consistency errors that may be triggering the byte-transfer mismatch.

Alternative or Verification Steps

  • After applying driver updates and AV exclusions, re-run the original backup/restore job and confirm it completes without Error 808 appearing in the SQL Server Error Log (EXEC xp_readerrorlog).
  • If the error persists, test the backup to a different physical disk or local drive (bypassing network/SAN) to isolate whether the root cause is storage-hardware related versus network-path related.

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

Troubleshooting Guide: SQL Server Error 810

Why This Error Happens

Error 810 occurs when SQL Server’s I/O subsystem receives an unexpected error code from the operating system while attempting to read from or write to a database file at a specific byte offset. While this error is designed to surface primarily in Azure SQL Database environments, its appearance on an on-premises Windows Server 2025 or Windows 11 instance typically indicates underlying storage corruption, a failing disk, filesystem-level inconsistencies, or interference from antivirus/backup software locking the file mid-operation. In most cases, this points to a breakdown in the reliability of the storage layer rather than a SQL Server configuration issue.

Step-by-Step Resolution Guide

Step 1: Run DBCC CHECKDB Immediately

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Execute DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to identify the scope of corruption.
  • Review the output for allocation errors, consistency errors, or specific page IDs flagged as damaged.
  • Document the exact file path and offset mentioned in the original Error 810 message for cross-referencing.

Step 2: Check Windows Event Viewer and Disk Health

  • Navigate to Event Viewer > Windows Logs > System and filter for Event ID 7, 11, or 51 (disk-related warnings).
  • Run chkdsk C: /f /r (or the appropriate drive letter hosting your .mdf/.ldf files) from an elevated Command Prompt; a reboot may be required if the volume is in use.
  • For SAN or virtualized storage, verify with your storage administrator that no underlying LUN or RAID array failures are occurring.
  • Check wevtutil qe System /q:"*[System[Provider[@Name='disk']]]" /f:text for low-level hardware fault logs.

Step 3: Exclude SQL Server Files from Antivirus and Backup Agents

  • Open your antivirus console (Windows Defender or third-party) and add exclusions for .mdf, .ndf, .ldf, and the full path of C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\.
  • Disable any third-party backup agent “open file” scanning features temporarily to rule out file-lock conflicts.
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER to clear any stale file handles.

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

  • If DBCC CHECKDB reports unrepairable corruption, locate your most recent verified full backup.
  • Use RESTORE DATABASE YourDatabaseName FROM DISK = 'E:\Backups\YourDatabase_Full.bak' WITH REPLACE, RECOVERY; to restore to a clean state.
  • Apply any subsequent differential or transaction log backups in sequence to minimize data loss.

Alternative or Verification Steps

  • After remediation, re-run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS; and confirm zero allocation or consistency errors are returned.
  • If errors recur on the same physical offset, treat it as a hardware fault — move the database files to a different physical disk or storage volume using ALTER DATABASE ... MODIFY FILE and monitor for recurrence.

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

Troubleshooting Guide: SQL Server Error 806 (Page Audit Failure)

Why This Error Happens

Error 806 occurs when SQL Server reads a page from disk into the buffer pool and detects that the page’s audit signature (a checksum-like value embedded in the page header) does not match the expected pattern. This typically indicates that the underlying storage subsystem, filter driver, or memory has silently altered or torn the page data outside of SQL Server’s control. Common root causes include faulty disk controllers, misbehaving antivirus/backup filter drivers intercepting I/O, unstable RAM, or improper shutdowns that corrupted data during a write operation.

Step-by-Step Resolution Guide

Step 1: Confirm the Scope of Corruption

  • Run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to identify which pages and objects are affected.
  • Check the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the specific File ID and Page ID referenced in the 806 message.
  • Cross-reference the Windows Event Viewer (System and Application logs) for corresponding Disk or NTFS warnings (Event ID 7 or 153) occurring at the same timestamp.

Step 2: Isolate and Test the Storage Hardware

  • Use chkdsk D: /f /r (replace D: with your data drive) in an elevated PowerShell/Command Prompt to scan for and repair physical sector errors.
  • Run the vendor-specific diagnostic utility for your SAN/NAS or local SSD/HDD to rule out firmware-level read/write failures.
  • Temporarily disable third-party antivirus or backup agents that use I/O filter drivers, as these are known to interfere with SQL Server’s direct I/O operations on Windows Server 2025.

Step 3: Restore the Affected Data

  • If a clean, uncorrupted backup exists, restore the specific affected page(s) using:
    RESTORE DATABASE YourDatabaseName PAGE='1:12345' FROM DISK = 'D:\Backups\YourDatabase.bak' WITH NORECOVERY;
  • Follow this with a transaction log restore to bring the page current: RESTORE LOG YourDatabaseName FROM DISK = 'D:\Backups\YourDatabase.trn' WITH RECOVERY;
  • If no backup is available, run DBCC CHECKDB ('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) only as a last resort, as this may delete corrupted rows entirely.

Step 4: Validate Memory and I/O Path Integrity

  • Run Windows Memory Diagnostic (mdsched.exe) to rule out RAM-level bit flips causing in-memory corruption before the write.
  • Verify the disk is configured with “Write-Through” caching disabled improperly; ensure SQL Server’s I/O requests are not being cached unsafely by the SAN controller.

Alternative or Verification Steps

  • Verification: Re-run DBCC CHECKDB immediately after the restore/repair step. A clean result with “0 allocation errors and 0 consistency errors” confirms resolution.
  • Alternative: If corruption recurs on the same LUN/volume after hardware checks pass, migrate the database files to a different physical disk array and monitor the PhysicalDisk counters in Performance Monitor for latency spikes exceeding 20ms, which often precede torn-page events.

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

Troubleshooting Guide: SQL Server Error 807

Why This Error Happens

Error 807 occurs when SQL Server 2025 attempts to read or verify a database page and detects that the physical media backing a database file is either missing, offline, or does not match the expected disk signature recorded in the file header. This typically happens when a database file resides on removable, mapped, or virtual disk storage (such as a disconnected VHD/VHDX, SAN LUN, or USB drive) that has been swapped, ejected, or reassigned a different drive letter. It can also surface after a failed storage migration or when Windows Server 2025 reassigns volume GUIDs during a reboot, causing SQL Server to no longer recognize the “correct” disk as being present.

Step-by-Step Resolution Guide

Step 1: Verify Physical and Virtual Disk Presence

  • Open Disk Management (diskmgmt.msc) on Windows Server 2025 / Windows 11 and confirm the volume hosting your .mdf/.ldf files is Online and shows the correct drive letter.
  • If using a VHD/VHDX, go to Disk Management > Action > Attach VHD and re-mount the correct virtual disk file.
  • For SAN/iSCSI storage, open iSCSI Initiator and confirm the target session is connected and persistent.

Step 2: Check Drive Letter and Path Consistency

  • Compare the path stored in SQL Server against the actual OS path using:
  SELECT name, physical_name FROM sys.master_files;
  • If the drive letter has changed (e.g., E: became F:), either reassign the original letter in Disk Management or update the file path using ALTER DATABASE [YourDB] MODIFY FILE.
  • Ensure no other application or container has locked/remapped the same drive letter.

Step 3: Restart SQL Server Service and Re-Validate Storage

  • Open Services.msc, locate SQL Server (MSSQLSERVER) or your named instance, and restart it.
  • Alternatively, run from an elevated PowerShell prompt:
  Restart-Service -Name 'MSSQLSERVER' -Force
  • Monitor the SQL Server Error Log (ERRORLOG in C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\) for confirmation that all database files were recognized successfully.

Step 4: Run Database Consistency Check

  • Once the database is back online, execute:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review output for any additional corruption flagged beyond the original disk-access error.

Alternative or Verification Steps

  • Confirm resolution by querying sys.databases and checking that state_desc returns ONLINE for the affected database.
  • If the disk cannot be recovered, restore the database from the most recent valid backup using RESTORE DATABASE [YourDB] FROM DISK = 'BackupPath' to a healthy storage volume.

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

Why This Error Happens

SQL Server Error 803 typically occurs when the database engine encounters an I/O-level failure while reading or writing to a database file, often due to a mismatch between the expected and actual file size on disk, disk corruption, or insufficient disk space. In simulated/debug scenarios, this is commonly triggered intentionally via DBCC commands or storage virtualization layers to test failover and recovery logic. The underlying cause is usually tied to the Windows Server 2025 storage subsystem failing to honor a read/write request at a specific file offset.

Step-by-Step Resolution Guide

Step 1: Verify Disk and File Integrity

  • Open SQL Server Management Studio (SSMS) and run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Check the physical disk health using Get-PhysicalDisk | Select FriendlyName, HealthStatus in PowerShell (Windows Server 2025).
  • Confirm the .mdf/.ldf file sizes on disk match what SQL Server expects via sys.master_files.

Step 2: Check Storage Configuration and Permissions

  • Navigate to Server Manager > Storage > Disk Management to confirm the volume hosting SQL data files is online and not in a degraded state.
  • Verify the SQL Server service account has Full Control on the data/log directory (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA).
  • Run icacls "C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA" to confirm NT SERVICE\MSSQLSERVER has appropriate rights.

Step 3: Clear Simulated Failure Flags (DEBUG Mode Only)

  • If using a debug/test harness, run DBCC STACKDUMP or clear the injected fault using your fault-injection tool’s reset command (e.g., Reset-SqlSimulatedFault -ErrorCode 803).
  • Restart the SQL Server (MSSQLSERVER) service via services.msc or Restart-Service MSSQLSERVER -Force in an elevated PowerShell session.

Step 4: Restore From Backup if Corruption Persists

  • If DBCC CHECKDB reports unrecoverable allocation errors, restore the affected database from the last known good backup using RESTORE DATABASE YourDatabaseName FROM DISK = 'BackupPath' WITH REPLACE;

Alternative or Verification Steps

  • Re-run DBCC CHECKDB and confirm zero allocation/consistency errors; check the SQL Server Error Log for cleared Error 803 entries.
  • If the issue persists in a DEBUG environment, confirm the fault-injection module is fully disabled by checking the simulation configuration file (e.g., C:\SQLDebug\fault_config.json) for an active 803 entry.

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

Why This Error Happens

Error 805 in SQL Server typically indicates that SQL Server encountered a memory page corruption or bad page ID while reading from the buffer pool, often triggered during a restore operation that was interrupted or left in a “RESTORE PENDING” state. This usually stems from insufficient Lock Pages in Memory privileges, a mismatch between the SQL Server service account’s memory allocation, or underlying disk I/O corruption affecting the database files (MDF/LDF). The “restore pending” symptom specifically occurs when SQL Server detects that the database requires additional log files or a completed restore sequence (e.g., a broken differential/log chain) before it can bring the database online.

Step-by-Step Resolution Guide

Step 1: Verify the Restore Chain and Database State

  • Run RESTORE DATABASE [YourDB] WITH RECOVERY; in SSMS or sqlcmd to attempt to force the database out of pending state.
  • Check sys.databases for the state_desc column to confirm it reads RESTORING rather than ONLINE.
  • If the log chain is broken, SQL Server will return Error 805 again — note the LSN (Log Sequence Number) in the error details for the next step.

Step 2: Check SQL Server Service Account Memory Permissions

  • Open Local Security Policy (secpol.msc) on Windows Server 2025 / Windows 11.
  • Navigate to Local Policies > User Rights Assignment > Lock Pages in Memory.
  • Ensure the SQL Server service account (e.g., NT Service\MSSQLSERVER) is listed; add it if missing, then restart the SQL Server service via services.msc.

Step 3: Run a Consistency Check on the Affected Database Files

  • Take the database offline temporarily: ALTER DATABASE [YourDB] SET OFFLINE;
  • Run DBCC CHECKDB ('YourDB', REPAIR_ALLOW_DATA_LOSS) only if a recent backup is unavailable — otherwise prefer restoring from a known-good full backup first.
  • Validate the physical files aren’t flagged read-only by checking file properties in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\.

Step 4: Rebuild the Restore Sequence from a Clean Backup Set

  • Restore the full backup with WITH NORECOVERY.
  • Apply any differential backups in order, also WITH NORECOVERY.
  • Apply the final transaction log backup WITH RECOVERY to bring the database fully online.

Step 5: Restart SQL Server Services and Confirm Event Log Clears

  • Restart the SQL Server (MSSQLSERVER) service and SQL Server Agent service from services.msc.
  • Open Event Viewer > Windows Logs > Application and confirm Error 805 no longer appears after the restart.

Alternative or Verification Steps

  • Run SELECT state_desc FROM sys.databases WHERE name = 'YourDB'; — it should now return ONLINE instead of RESTORING.
  • If the issue persists, restore the entire database to a new instance on Windows Server 2025 from the last verified clean backup, then redirect application connections to confirm data integrity before decommissioning the corrupted instance.

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

Troubleshooting Guide: SQL Server Error 801 – Buffer Status Mismatch

Why This Error Happens

Error 801 occurs when the SQL Server Storage Engine reads a page buffer from memory or disk and finds that its internal status flag does not match what the Buffer Manager expected during an I/O operation. This is almost always indicative of underlying hardware instability, a faulty storage driver, or memory corruption affecting the buffer pool, rather than a logical issue within the database schema itself. In rare cases, it can also stem from a conflict between SQL Server’s I/O requests and third-party antivirus or backup software intercepting disk reads.

Step-by-Step Resolution Guide

Step 1: Run Immediate Consistency Checks

  • Open SQL Server Management Studio (SSMS) or sqlcmd connected to the affected instance.
  • Execute DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to identify if the corruption is isolated to specific pages or indexes.
  • Check the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for correlating I/O warnings occurring just before the Error 801 event.

Step 2: Validate Storage Hardware and Drivers

  • Open Windows Event Viewer and navigate to Windows Logs > System to check for Disk or Controller warnings (Event ID 11 or 51) that align with the SQL timestamp.
  • Update the storage controller drivers (SATA/RAID/SAN HBA) via Windows Update or the OEM vendor site (Dell, HPE, etc.).
  • If running on a Virtual Machine (Hyper-V/VMware), verify the virtual disk is not Dynamically Expanding, as this can introduce latency-based buffer mismatches; convert to Fixed Size if possible.

Step 3: Isolate Third-Party I/O Filters

  • Temporarily disable real-time scanning for the SQL Data (.mdf) and Log (.ldf) directories in your Antivirus software (e.g., Windows Defender, McAfee).
  • Add official Microsoft-recommended exclusions by running this PowerShell command as Administrator:
  Add-MpPreference -ExclusionPath "C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA"
  • Restart the SQL Server (MSSQLSERVER) service via services.msc to clear the existing buffer pool cache and force a clean read.

Step 4: Restore From a Known Good Backup

  • If DBCC CHECKDB reports allocation errors tied to the 801 event, do not attempt automatic repair (REPAIR_ALLOW_DATA_LOSS) as a first resort.
  • Restore the specific database from the last verified clean backup to a test environment to confirm data integrity before promoting it to production.

Alternative or Verification Steps

  • Verification: Run DBCC CHECKDB again after restarting the SQL service; if the command completes with “0 allocation errors and 0 consistency errors,” the buffer pool has been successfully refreshed.
  • Alternative: If the error persists immediately after a service restart, run the Windows built-in chkdsk C: /f /r tool (requires reboot) to rule out underlying NTFS file system corruption on the volume hosting the SQL data files.

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

Troubleshooting Guide: SQL Server Error 802 — Insufficient Memory in Buffer Pool

Why This Error Happens

Error 802 occurs when SQL Server 2025 cannot allocate enough memory to the buffer pool to meet the needs of the “max server memory” configuration or AWE-related settings at startup or during heavy workload operations. This typically results from a misconfigured minimum/maximum memory setting, insufficient physical RAM on the Windows Server 2025 / Windows 11 host, or the SQL Server service account lacking the “Lock Pages in Memory” privilege. It can also occur when other applications or SQL instances are competing for the same physical memory pool, leaving too little for SQL Server’s buffer pool to initialize properly.

Step-by-Step Resolution Guide

Step 1: Verify Physical Memory and Current SQL Server Allocation

  • Open Task Manager or Performance Monitor on Windows Server 2025 / Windows 11 and check total physical RAM versus committed memory.
  • Run the following query in SSMS to check current configuration:
  EXEC sp_configure 'max server memory';
  • Confirm no other memory-intensive processes (IIS, other SQL instances, containers) are starving the system.

Step 2: Adjust Min/Max Server Memory Configuration

  • Open SSMS, right-click the server instance → Properties → Memory.
  • Set Maximum server memory (MB) to a value that leaves at least 4–8 GB free for the OS (e.g., if the server has 32 GB RAM, set max to 24000 MB).
  • Alternatively, run:
  EXEC sp_configure 'max server memory', 24000;
  RECONFIGURE WITH OVERRIDE;
  • Restart the SQL Server service via Services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 3: Grant “Lock Pages in Memory” Privilege

  • Open Local Security Policy (secpol.msc) on Windows Server 2025 / Windows 11.
  • Navigate to Local Policies → User Rights Assignment → Lock pages in memory.
  • Add the SQL Server service account (e.g., NT SERVICE\MSSQLSERVER) to this policy.
  • Restart the SQL Server service for the change to take effect.

Step 4: Check for Memory Pressure from OS-Level Settings

  • Confirm Windows Server 2025 is not throttling memory via Hyper-V Dynamic Memory (if virtualized) — set to Static Memory Allocation instead.
  • Check Group Policy or MDM profiles pushing memory limits on Windows 11 devices running SQL Server (Developer/Express editions).
  • Review the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\ERRORLOG) for prior 802 occurrences and correlate timestamps with system events.

Step 5: Rebuild or Increase tempdb and Buffer Pool Extension (If Applicable)

  • If using Buffer Pool Extension (BPE) on SSD storage, verify the BPE file path is valid and has enough free disk space.
  • Reconfigure BPE size via:
  ALTER SERVER CONFIGURATION SET BUFFER POOL EXTENSION ON 
  (FILENAME = 'E:\SQLCache\BPE.bin', SIZE = 20GB);

Alternative or Verification Steps

  • After restarting the SQL Server service, run DBCC MEMORYSTATUS and confirm the buffer pool is allocating memory without errors in the ERRORLOG.
  • If Error 802 persists, consider adding physical RAM to the host or migrating to a server with higher memory capacity, and temporarily lower max server memory as a stopgap.

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

Troubleshooting Guide: SQL Server Error 708 – Low Virtual Address Space

Why This Error Happens

This error occurs when SQL Server 2025 exhausts available virtual address space (VAS), typically on systems still running a 32-bit instance or a heavily constrained 64-bit environment with excessive AWE/locked pages configuration. It can also arise from memory fragmentation caused by a very high number of concurrent connections, excessive ad-hoc query plans bloating the plan cache, or third-party memory-scanning software (like antivirus) hooking into the SQL Server process space. Additionally, running SQL Server alongside other memory-intensive applications on Windows Server 2025 without proper “max server memory” configuration can force the OS to starve SQL Server’s reserved VAS.

Step-by-Step Resolution Guide

Step 1: Verify SQL Server Architecture and OS Compatibility

  • Confirm you are running the 64-bit version of SQL Server 2025 (SELECT @@VERSION; should show “X64”).
  • Check Windows Server 2025 / Windows 11 is also 64-bit (Settings > System > About).
  • If a legacy 32-bit instance is detected, plan a migration to 64-bit immediately, as VAS limits differ drastically (2GB/3GB vs. terabytes).

Step 2: Configure Max Server Memory Correctly

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Run the following to check current settings:
  EXEC sp_configure 'show advanced options', 1;
  RECONFIGURE;
  EXEC sp_configure 'max server memory';
  • Set max server memory to leave at least 20-25% of physical RAM for the OS and other processes:
  EXEC sp_configure 'max server memory', 24576; -- example: 24GB
  RECONFIGURE;
  • Restart the SQL Server service via services.msc or Restart-Service MSSQLSERVER in PowerShell.

Step 3: Reduce Plan Cache Bloat and Ad-Hoc Query Overhead

  • Enable “Optimize for Ad Hoc Workloads” to prevent excessive plan cache consumption:
  EXEC sp_configure 'optimize for ad hoc workloads', 1;
  RECONFIGURE;
  • Clear the existing bloated cache if immediate relief is needed:
  DBCC FREESYSTEMCACHE('ALL');

Step 4: Check for Memory-Locking Pages Conflicts

  • Navigate to Local Security Policy > Local Policies > User Rights Assignment > Lock Pages in Memory.
  • Ensure only the SQL Server service account is granted this right; remove conflicting accounts.
  • Restart the SQL Server service to apply changes.

Step 5: Monitor and Adjust Windows Virtual Memory (Pagefile)

  • Go to Control Panel > System > Advanced System Settings > Performance Settings > Advanced > Virtual Memory.
  • Set a custom pagefile size (e.g., 1.5x physical RAM) rather than relying on “System Managed” if VAS pressure persists.
  • Apply changes and reboot Windows Server 2025 / Windows 11.

Alternative or Verification Steps

  • Run DBCC MEMORYSTATUS; in SSMS after implementing changes and confirm the “Reserved memory used” counter is no longer incrementing under normal load.
  • If the error persists, use Performance Monitor (perfmon.exe) to track the SQLServer:Memory Manager > Total Server Memory (KB) counter alongside Process > Virtual Bytes for sqlservr.exe to identify if a specific query or extended stored procedure is causing an external VAS leak.

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

Troubleshooting Guide: SQL Server Error 709 – Available Memory Lower Than Configured Maximum

Why This Error Happens

Error 709 occurs when SQL Server 2025 detects that the actual available physical memory on the host is lower than the value configured for “max server memory.” This typically happens due to external memory pressure from other applications or OS-level services competing for RAM, incorrect memory configuration that doesn’t account for the total system resources, or faulty/failing physical RAM modules. In virtualized environments, this can also be triggered by hypervisor-level memory ballooning or dynamic memory reallocation on Windows Server 2025.

Step-by-Step Resolution Guide

Step 1: Verify Current Memory Configuration in SQL Server

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run the following query to check current settings:
  EXEC sp_configure 'max server memory';
  EXEC sp_configure 'min server memory';
  • Compare the configured max server memory value against the total physical RAM reported by Windows (check via Task Manager > Performance tab, or systeminfo in Command Prompt).

Step 2: Reduce Max Server Memory to a Safe Threshold

  • Calculate a safer value: leave at least 4-8 GB (or 10-20% of total RAM) for the OS and other processes.
  • Run the following T-SQL command to adjust the setting:
  EXEC sp_configure 'show advanced options', 1;
  RECONFIGURE;
  EXEC sp_configure 'max server memory', 16384; -- example: 16 GB in MB
  RECONFIGURE;
  • Restart the SQL Server service via Services.msc or net stop MSSQLSERVER && net start MSSQLSERVER.

Step 3: Identify and Eliminate External Memory Pressure

  • Open Task Manager or Resource Monitor on Windows Server 2025 to identify other processes consuming excessive RAM.
  • Check for competing services such as IIS, Analysis Services, or third-party backup agents running on the same host.
  • If running in a virtual machine, verify the hypervisor is not dynamically reducing allocated memory (disable Dynamic Memory in Hyper-V settings if applicable).

Step 4: Run Hardware Diagnostics for Faulty RAM

  • Use Windows Memory Diagnostic tool by typing mdsched.exe in the Run dialog and selecting “Restart now and check for problems.”
  • Alternatively, run Get-PhysicalMemory via PowerShell or check the Event Viewer under Windows Logs > System for Hardware Error events (Event ID 1101 or WHEA-Logger entries).
  • If errors are detected, contact your hardware vendor to replace the faulty memory module(s).

Step 5: Review SQL Server Error Log for Recurrence

  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG (adjust path based on your instance version/name).
  • Search for repeated Error 709 entries to determine if the issue is transient or persistent.
  • Cross-reference timestamps with Windows Event Viewer logs to correlate memory pressure events.

Alternative or Verification Steps

  • After applying changes, monitor SQL Server’s memory usage using Performance Monitor (PerfMon) with the counter SQLServer:Memory Manager > Total Server Memory (KB) over a 24-48 hour period to confirm stability.
  • If the error persists despite configuration changes, consider migrating the instance to a host with more available RAM or isolating SQL Server onto a dedicated server without competing workloads.

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

Troubleshooting Guide: SQL Server Error 698 – Blob Container Accessor Failure

Why This Error Happens

Error 698 typically occurs when SQL Server 2025’s integrated BLOB storage engine (used for FILESTREAM and native blob container integration with Azure-style storage pools) cannot authenticate or mount the underlying container accessor service. This is most commonly caused by an expired or misconfigured Shared Access Signature (SAS) token, a corrupted local cache of the blob container metadata, or insufficient NTFS/Service permissions on the Windows Server 2025 host running the SQL Server service account. In some cases, this is triggered by a Windows Defender Firewall rule blocking the internal loopback port used by the Blob Accessor Service (BAS).

Step-by-Step Resolution Guide

Step 1: Verify the Blob Accessor Service Status

  • Open Services.msc on Windows Server 2025 / Windows 11 and locate SQLBlobAccessorSvc.
  • Ensure the service is set to Automatic (Delayed Start) and is currently running.
  • If stopped, attempt a manual restart via PowerShell: Restart-Service -Name "SQLBlobAccessorSvc" -Force
  • Check the Application Event Log for any secondary errors (Event ID 700 or 701) occurring immediately before Error 698.

Step 2: Validate Storage Credentials and Permissions

  • Open SQL Server Configuration Manager and navigate to the FILESTREAM/Blob Integration tab.
  • Confirm that the SAS token or Managed Identity credentials linked to the blob container have not expired.
  • Verify the SQL Server service account (e.g., NT SERVICE\MSSQLSERVER) has explicit Read/Write/Modify NTFS permissions on the local cache directory, typically located at C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Blob\Cache.
  • Re-authenticate the container using: EXEC sp_configure_blob_container 'refresh_auth';

Step 3: Clear Corrupted Local Blob Cache

  • Stop the SQL Server service entirely to release file locks: Stop-Service -Name "MSSQLSERVER" -Force
  • Navigate to the local blob cache directory and rename the folder to Cache_old (do not delete immediately in case a rollback is needed).
  • Restart the SQL Server service to force the engine to rebuild a fresh cache index: Start-Service -Name "MSSQLSERVER"

Step 4: Check Firewall and Port Configuration

  • Ensure that Windows Defender Firewall (or any third-party firewall) is not blocking the internal loopback port (default 1451) used for the Blob Accessor communication.
  • Add an inbound/outbound rule specifically for sqlservr.exe if custom firewall policies are active in your Windows Server 2025 environment.

Alternative or Verification Steps

  • To verify the fix, run SELECT * FROM sys.dm_blob_container_status; in SSMS; the status column should return HEALTHY instead of ERROR_698.
  • If the error persists after cache clearing, use the Repair option in the SQL Server 2025 Installation Center to reset the Blob Accessor binaries without affecting existing databases.

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

Troubleshooting Guide: Error 699 – Failure to Read Data from Azure Block Blob Storage

Why This Error Happens

Error 699 typically occurs when SQL Server 2025 cannot establish a valid, authenticated connection to the Azure Block Blob Storage container referenced by BACKUP, RESTORE, or BULK INSERT operations. This is most commonly caused by an expired or malformed Shared Access Signature (SAS) token, an incorrect storage credential mapped in SQL Server, or network-level blocking (firewall/proxy) preventing outbound HTTPS traffic to the *.blob.core.windows.net endpoint. In some cases, the underlying 0x%X code indicates the blob itself is missing, renamed, or the container access tier (e.g., Archive) prevents immediate read access.

Step-by-Step Resolution Guide

Step 1: Validate the SQL Server Credential and SAS Token

  • Run SELECT * FROM sys.credentials; in SSMS to locate the credential tied to your storage account URL.
  • Check the SAS token expiration date in Azure Portal under Storage Account > Shared Access Signature.
  • If expired, generate a new SAS token with at least Read, List, and Write permissions.
  • Update the credential using:
  ALTER CREDENTIAL [https://<youraccount>.blob.core.windows.net/<container>]
  WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
  SECRET = '<new_sas_token_without_leading_?>';

Step 2: Verify Network Connectivity to Azure Storage

  • On Windows Server 2025 / Windows 11, open PowerShell and test connectivity:
  Test-NetConnection -ComputerName <youraccount>.blob.core.windows.net -Port 443
  • Confirm outbound port 443 is not blocked by Windows Defender Firewall or a corporate proxy.
  • If using a private endpoint, verify DNS resolution points to the private IP via nslookup <youraccount>.blob.core.windows.net.

Step 3: Confirm Blob Existence and Access Tier

  • In Azure Portal, navigate to Storage Account > Containers > [your container] and confirm the target blob (e.g., backup.bak) exists and matches the exact path referenced in your T-SQL command.
  • Check the Access Tier; if set to Archive, rehydrate the blob to Hot or Cool tier before attempting to read it.
  • Ensure the container’s public access level or RBAC role (Storage Blob Data Reader/Contributor) is correctly assigned if using Managed Identity instead of SAS.

Step 4: Restart SQL Server Service and Retry Operation

  • Open Services.msc (or services.msc via Run) and restart the SQL Server (MSSQLSERVER) service to clear cached credential tokens.
  • Re-run the failing RESTORE or BULK INSERT command and monitor the SQL Server Error Log (Management > SQL Server Logs) for confirmation of successful blob access.

Alternative or Verification Steps

  • Verify the fix by running a lightweight test: RESTORE VERIFYONLY FROM URL = 'https://<youraccount>.blob.core.windows.net/<container>/<file>.bak'; — a successful return with no errors confirms connectivity and permissions are restored.
  • If the issue persists, switch authentication method entirely from SAS token to a User-Assigned Managed Identity with Storage Blob Data Contributor role, which eliminates token-expiration-related failures.

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

Troubleshooting Guide: SQL Server Error 701 – Insufficient System Memory in Resource Pool

Why This Error Happens

Error 701 occurs when SQL Server’s Resource Governor has restricted a memory-intensive query to a resource pool that lacks sufficient memory to execute it, often because the pool’s MAX_MEMORY_PERCENT is set too low relative to the query’s actual demands. This can also happen when the overall SQL Server instance is under memory pressure due to competing workloads, an undersized max server memory configuration, or Windows Server 2025/Windows 11 reclaiming memory for other system processes. Additionally, plan cache bloat, excessive parallelism (high MAXDOP), or a poorly optimized query requesting a large memory grant can trigger this even when total system memory appears adequate.

Step-by-Step Resolution Guide

Step 1: Verify Current Resource Governor Configuration

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Run the following query to check pool settings:
  SELECT * FROM sys.dm_resource_governor_resource_pools;
  • Identify the specific pool named in the error message and note its max_memory_percent and min_memory_percent values.

Step 2: Increase Memory Allocation for the Affected Resource Pool

  • Use ALTER RESOURCE POOL to raise the memory ceiling:
  ALTER RESOURCE POOL [YourPoolName]
  WITH (MAX_MEMORY_PERCENT = 50);
  ALTER RESOURCE GOVERNOR RECONFIGURE;
  • If the pool is not essential, consider disabling Resource Governor entirely for testing:
  ALTER RESOURCE GOVERNOR DISABLE;

Step 3: Adjust SQL Server’s Max Server Memory Setting

  • Navigate to SSMS > Right-click Server > Properties > Memory tab.
  • Ensure max server memory (MB) is not set too conservatively — leave at least 4-6 GB free for the OS on Windows Server 2025/Windows 11.
  • Alternatively, run:
  EXEC sp_configure 'max server memory (MB)', 16384;
  RECONFIGURE;

Step 4: Optimize the Offending Query’s Memory Grant

  • Use Query Store or sys.dm_exec_query_memory_grants to identify queries requesting excessive memory.
  • Add or update statistics on large tables involved in the query:
  UPDATE STATISTICS dbo.YourTable WITH FULLSCAN;
  • Consider adding a query hint to cap grant size if the issue is isolated to one query:
  OPTION (MIN_GRANT_PERCENT = 0, MAX_GRANT_PERCENT = 25)

Step 5: Check Windows Server Memory Pressure

  • Open Task Manager or Performance Monitor (perfmon.exe) and check Available MBytes under Memory counters.
  • Confirm no other applications (IIS, containers, or antivirus scanning) are consuming excessive RAM on the host.
  • Restart the SQL Server service if configuration changes require a full reload: net stop MSSQLSERVER && net start MSSQLSERVER.

Alternative or Verification Steps

  • Re-run the original failing query and confirm Error 701 no longer appears; monitor sys.dm_resource_governor_resource_pools to verify memory usage stays within the new threshold.
  • If the error persists, consider moving the workload to the default resource pool temporarily or increasing physical RAM/VM memory allocation on the Windows Server 2025 host.

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

Troubleshooting Guide: Error 696 – Unable to Gain Access to the Tombstone Table

Why This Error Happens

Error 696 typically occurs when SQL Server’s replication or change-tracking subsystem attempts to access the internal tombstone table (used to track deleted rows for merge replication or change tracking) but encounters a locking conflict, corruption, or insufficient permissions on the underlying system table. This often results from an interrupted cleanup process, a damaged system catalog, or a mismatch between the database schema version and the replication metadata. In some cases, the issue stems from the SQL Server service account lacking the required access rights to internal sys.syscommittab structures after an OS-level permission change on Windows Server 2025.

Step-by-Step Resolution Guide

Step 1: Verify Service Account Permissions

  • Open Services.msc on Windows Server 2025 / Windows 11 and confirm the SQL Server service is running under the correct domain or virtual service account.
  • Ensure the account has db_owner rights on the affected database and is not restricted by a recently modified Group Policy Object (GPO).
  • Run the following T-SQL to confirm database role membership:
  EXEC sp_helprotect NULL, NULL, 'sys.syscommittab';

Step 2: Check for Tombstone Table Corruption

  • Run DBCC CHECKDB against the affected database to identify corruption in system tables:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is confirmed in sys.syscommittab, note the page IDs reported for further repair.
  • Cross-reference the SQL Server Error Log located at C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG for related I/O warnings.

Step 3: Disable and Re-enable Change Tracking

  • Temporarily disable change tracking on the affected table and database to release any stale locks on the tombstone table:
  ALTER TABLE YourTable DISABLE CHANGE_TRACKING;
  ALTER DATABASE YourDatabaseName SET CHANGE_TRACKING = OFF;
  • Restart the SQL Server service via PowerShell:
  Restart-Service -Name 'MSSQLSERVER' -Force
  • Re-enable change tracking once the service restarts cleanly:
  ALTER DATABASE YourDatabaseName SET CHANGE_TRACKING = ON (CHANGE_RETENTION = 2 DAYS, AUTO_CLEANUP = ON);
  ALTER TABLE YourTable ENABLE CHANGE_TRACKING;

Step 4: Rebuild System Indexes on Tombstone Structures

  • If the error persists, rebuild internal indexes tied to sys.syscommittab:
  ALTER INDEX ALL ON sys.syscommittab REBUILD;
  • Monitor Windows Event Viewer under Applications and Services Logs > Microsoft > SQL Server for Event ID 696 recurrence.

Alternative or Verification Steps

  • To verify the fix, run a manual cleanup task using sp_flush_commit_table_on_demand and confirm no error is thrown in the SQL Server Management Studio (SSMS) output pane.
  • If the issue persists after all steps, restore the database from the last known good backup taken before the corruption was introduced, then reapply change tracking configurations.

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

Troubleshooting Guide: SQL Server Error 697 — “Internal error. Unable to get a blob storage container.”

Why This Error Happens

This error typically occurs when SQL Server 2025’s native BLOB storage integration (used for backups, PolyBase, or external data virtualization to Azure Blob Storage / S3-compatible storage) cannot authenticate or establish a connection with the configured storage container. The root cause is usually invalid or expired credentials (SAS tokens, access keys, or Managed Identity misconfiguration), a firewall/network rule blocking outbound HTTPS traffic to the storage endpoint, or a corrupted Database Scoped Credential mapping. In some cases, this also results from the storage container being deleted, renamed, or having its access tier changed outside of SQL Server’s awareness.

Step-by-Step Resolution Guide

Step 1: Verify the Database Scoped Credential and Storage Account Access

  • Run SELECT * FROM sys.database_scoped_credentials; to confirm the credential exists and references the correct identity.
  • Check that the SAS token or access key hasn’t expired by reviewing the “Expiry” timestamp in Azure Portal (Storage Account > Shared Access Signature).
  • If using Managed Identity, confirm the SQL Server service account has the “Storage Blob Data Contributor” role assigned via IAM settings on the storage account.

Step 2: Test Network Connectivity to the Blob Endpoint

  • Open PowerShell as Administrator and run:
  Test-NetConnection -ComputerName <youraccount>.blob.core.windows.net -Port 443
  • Ensure Windows Defender Firewall (Windows Server 2025 / Windows 11) is not blocking outbound port 443 for sqlservr.exe.
  • If using a proxy, confirm the proxy settings are correctly registered in netsh winhttp show proxy since SQL Server uses WinHTTP for outbound blob calls.

Step 3: Recreate the External Data Source and Credential

  • Drop the existing external data source using:
  DROP EXTERNAL DATA SOURCE MyBlobStorage;
  • Recreate it with a fresh, validated SAS token or updated Managed Identity binding:
  CREATE EXTERNAL DATA SOURCE MyBlobStorage
  WITH ( LOCATION = 'https://<youraccount>.blob.core.windows.net/<container>',
         CREDENTIAL = MyBlobCredential );
  • Confirm the container name in the LOCATION path matches exactly (case-sensitive) with what exists in Azure Storage Explorer.

Step 4: Restart the SQL Server Service and Clear Cached Tokens

  • Open services.msc, restart the “SQL Server (MSSQLSERVER)” service to clear any cached authentication tokens.
  • Alternatively, run in an elevated Command Prompt:
  net stop MSSQLSERVER && net start MSSQLSERVER
  • Check the SQL Server Error Log (Management > SQL Server Logs) immediately after restart for renewed Error 697 occurrences.

Alternative or Verification Steps

  • Verify the fix by executing a test backup to the blob container: BACKUP DATABASE TestDB TO URL = 'https://<youraccount>.blob.core.windows.net/<container>/test.bak'; — success confirms connectivity and permissions are restored.
  • If the issue persists, use Azure Storage Explorer to manually browse the container using the same credentials configured in SQL Server; if that also fails, the problem lies in Azure IAM/storage configuration rather than SQL Server itself.

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

Why This Error Happens

Error 692 typically indicates that SQL Server’s storage engine has encountered a fixed-length column whose data buffer exceeds the maximum size defined by the column’s metadata, often due to page-level corruption or a mismatch between the data page structure and the table schema. This can result from disk-level corruption, incomplete writes during an unexpected shutdown, or bit-flips in memory that propagated to disk. In rare cases, it may also occur due to a bug in a specific SQL Server 2025 build interacting with corrupted system catalog views.

Step-by-Step Resolution Guide

Step 1: Isolate and Confirm Corruption

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and connect to the affected instance.
  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to get a full corruption report.
  • Note the specific object ID, page ID, and index ID reported in the error output for targeted repair.

Step 2: Check Hardware and Storage Integrity

  • Review the Windows Event Viewer (Application and System logs) for disk-related warnings (Event ID 7, 9, 51, or 153) that indicate underlying storage failures.
  • On Windows Server 2025/Windows 11, run Get-PhysicalDisk | Get-StorageReliabilityCounter in PowerShell to check for read/write errors or wear indicators on the underlying drives.
  • If using virtualized storage, verify the integrity of the VHDX or SAN-mapped volume hosting the .mdf and .ldf files.

Step 3: Restore From a Known Good Backup

  • If corruption is confirmed and isolated to a small number of pages, restore the affected pages using RESTORE DATABASE YourDatabaseName PAGE = 'FileID:PageID' FROM DISK = 'BackupPath.bak' WITH NORECOVERY; followed by a log restore.
  • If no page-level backup strategy exists, perform a full database restore from the last verified clean backup taken before the corruption timestamp.
  • Ensure the backup source is stored on a separate physical volume to avoid restoring from the same corrupted media.

Step 4: Repair as a Last Resort

  • If no valid backup is available, run DBCC CHECKDB('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) only after taking a fresh backup of the current (corrupted) state.
  • Understand that this operation may deallocate corrupted rows or pages, resulting in permanent data loss for those specific records.
  • Re-run DBCC CHECKDB afterward to confirm no further corruption remains.

Alternative or Verification Steps

  • After remediation, run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS; again to confirm a clean result with zero allocation and consistency errors.
  • If the error recurs immediately after repair, run built-in Windows memory diagnostics (mdsched.exe) and a storage vendor’s disk-check utility, as recurring corruption often points to failing RAM or a failing physical disk rather than a SQL Server software issue.

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

Troubleshooting Guide: Error 694 – Unable to Create Block Blob in Azure Storage

Why This Error Happens

Error 694 typically occurs when SQL Server 2025 cannot authenticate or communicate properly with the target Azure Storage account while attempting to write backup or data files as block blobs. This is most commonly caused by an expired or invalid Shared Access Signature (SAS) token, incorrect storage credentials configured in SQL Server, or network-level restrictions (firewall, proxy, or TLS mismatch) blocking outbound HTTPS traffic to the *.blob.core.windows.net endpoint. In some cases, the local SQL Server credential object may be corrupted or referencing a deprecated storage account key.

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 Azure Storage container exists and is not expired.
  • Regenerate the SAS token from the Azure Portal (Storage Account > Shared Access Signature) with read, write, list, and create permissions enabled.
  • Drop and recreate the credential using:
  CREATE CREDENTIAL [https://<youraccount>.blob.core.windows.net/<container>]
  WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
  SECRET = '<new_sas_token>';

Step 2: Verify Network Connectivity and TLS Configuration

  • On Windows Server 2025 / Windows 11, open PowerShell and test connectivity:
  Test-NetConnection <youraccount>.blob.core.windows.net -Port 443
  • Ensure TLS 1.2 or higher is enabled in the registry under HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols.
  • Confirm no corporate proxy or Windows Defender Firewall rule is blocking outbound traffic on port 443 to Azure endpoints.

Step 3: Check Storage Account Permissions and Container Access

  • In the Azure Portal, navigate to Storage Account > Access Control (IAM) and confirm the service principal or account has the Storage Blob Data Contributor role.
  • Verify the target container exists and that the blob naming path does not exceed 1,024 characters (a common silent cause of blob creation failure).
  • If using Managed Identity instead of SAS, confirm the identity is correctly assigned via:
  Get-AzRoleAssignment -Scope "/subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.Storage/storageAccounts/<account>"

Step 4: Restart SQL Server Services and Clear Cached Credentials

  • Restart the SQL Server service via services.msc or run:
  Restart-Service -Name 'MSSQLSERVER'
  • Clear any cached authentication tokens by restarting the SQL Server VSS Writer and SQL Server Agent services as well.

Alternative or Verification Steps

  • Re-run the backup or blob creation operation (BACKUP DATABASE ... TO URL) and confirm no Error 694 appears in SQL Server Error Log or Event Viewer under Application Logs.
  • As an alternative, switch authentication method from SAS token to Managed Identity (if running on Azure-connected Windows Server 2025), which eliminates token expiration issues entirely.

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

Troubleshooting Guide: Error 695 – Unable to Delete Block Blob in Azure Storage

Why This Error Happens

Error 695 typically occurs when SQL Server 2025’s Backup to URL or Managed Backup feature cannot properly delete an existing block blob due to a mismatch in blob type, lease state, or stale storage credentials. This often happens when a blob was previously created as a page blob but SQL Server attempts to manage it as a block blob, or when the Shared Access Signature (SAS) token/storage account key has expired or lacks delete permissions. Corrupted blob metadata or an active lease on the blob (held by another process or a failed prior transaction) can also block the deletion request.

Step-by-Step Resolution Guide

Step 1: Verify Storage Credentials and Permissions

  • Open SQL Server Management Studio (SSMS) and check the credential used for the backup device via SELECT * FROM sys.credentials;
  • Ensure the SAS token has not expired and includes Delete and Write permissions (not just Read/List).
  • If using a Storage Account Key, regenerate it in the Azure Portal under Storage Account > Access Keys, then update the SQL credential using:
  ALTER CREDENTIAL [https://<youraccount>.blob.core.windows.net/<container>]
  WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
  SECRET = '<new_sas_token>';

Step 2: Check for Blob Type Conflicts or Active Leases

  • Use Azure Storage Explorer to navigate to the target container and inspect the specific .bak or .trn file.
  • Confirm the blob type; SQL Server 2025 requires Block Blobs exclusively (Page Blobs are only supported in legacy configurations).
  • If a lease is active (visible in the blob’s properties as “Leased”), break the lease manually using PowerShell:
  $blob = Get-AzStorageBlob -Container "backups" -Blob "yourfile.bak" -Context $ctx
  $blob.ICloudBlob.BreakLease()

Step 3: Clear Local Cache and Restart Services

  • On the Windows Server 2025 / Windows 11 host, clear any local SQL Server backup cache located in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Backup\.
  • Restart the SQL Server service to release any locked handles on the network module:
  Restart-Service -Name 'MSSQLSERVER' -Force
  • Re-run the backup or delete command that triggered the original error to confirm the connection resets correctly.

Alternative or Verification Steps

  • Verify the fix: Run a manual test backup using BACKUP DATABASE [TestDB] TO URL = 'https://<account>.blob.core.windows.net/<container>/test.bak' and confirm the old blob is successfully overwritten/deleted without throwing Error 695.
  • Alternative solution: If the error persists, delete the specific orphaned blob directly via the Azure Portal or az storage blob delete CLI command, then allow SQL Server to recreate a fresh backup chain rather than attempting an in-place overwrite.

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

Troubleshooting Guide: SQL Server Error 688 – Online Index Build Conflict

Why This Error Happens

Error 688 occurs when a session attempts to execute a DDL operation (such as ALTER TABLE, dropping a column, or modifying a schema) on a table that currently has an active online index build in progress. SQL Server 2025 locks certain metadata operations during online index creation or rebuild (CREATE INDEX ... WITH (ONLINE = ON)) to maintain data consistency for concurrent readers and writers. This typically happens when a long-running index maintenance job overlaps with an automated deployment script, ETL process, or another administrator’s schema change request.

Step-by-Step Resolution Guide

Step 1: Identify the Active Index Build Session

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio connected to the affected instance.
  • Run the following query to locate the blocking operation:
  SELECT session_id, command, percent_complete, start_time, status
  FROM sys.dm_exec_requests
  WHERE command LIKE '%INDEX%';
  • Note the session_id and estimated percent_complete to determine if the build is near completion.

Step 2: Wait or Terminate the Conflicting Process

  • If the index build is close to finishing (90%+), allow it to complete naturally rather than killing it, as terminating a large online rebuild can trigger a costly rollback.
  • If the process is stuck or low priority, terminate it safely using:
  KILL <session_id>;
  • Monitor rollback progress via sys.dm_exec_requests to ensure the kill command processes cleanly.

Step 3: Adjust Application/Deployment Scripts to Prevent Overlap

  • Modify your deployment pipeline (e.g., Azure DevOps, Jenkins) to check for active index operations before pushing schema changes.
  • Add a pre-deployment gate script that queries sys.dm_exec_requests and pauses execution if command contains CREATE INDEX or ALTER INDEX.
  • On Windows Server 2025, ensure the SQL Server Agent job scheduler (via sqlagent.exe) does not overlap index maintenance windows with deployment windows in Task Scheduler or SQL Server Agent Jobs.

Step 4: Reduce Index Build Duration (Optional Optimization)

  • Navigate to SQL Server Configuration Manager > SQL Server Services and verify MAXDOP settings are optimized for parallel index builds.
  • Consider using RESUMABLE = ON for large online index operations so builds can be paused instead of blocking other DDL requests:
  CREATE INDEX idx_example ON dbo.LargeTable(ColumnName)
  WITH (ONLINE = ON, RESUMABLE = ON, MAX_DURATION = 60 MINUTES);

Alternative or Verification Steps

  • After resolution, re-run your original DDL statement to confirm Error 688 no longer appears in the SQL Server Error Log (viewable via Event Viewer > Applications and Services Logs > MSSQLSERVER).
  • If the error persists across multiple attempts, consider scheduling schema changes during a maintenance window and disabling automatic index maintenance jobs temporarily via SQL Server Agent.

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

Troubleshooting Guide: SQL Server Error 689 – Pending Cleanup of Online Index Build

Why This Error Happens

Error 689 occurs when SQL Server 2025 is still performing background cleanup work after an online index rebuild or creation operation has completed its main phase. This typically happens because the internal worker thread responsible for releasing old index versions and reclaiming space has not yet finished, often due to long-running transactions holding references to the old index structure. Attempting to run another DDL operation (like ALTER INDEX or DROP INDEX) on the same object while this cleanup is still in progress triggers the block.

Step-by-Step Resolution Guide

Step 1: Identify Blocking Sessions and Active Cleanup Tasks

  • Open SQL Server Management Studio (SSMS) connected to your instance.
  • Run the following query to check for active online index operations:
SELECT * FROM sys.dm_exec_requests 
WHERE command LIKE '%INDEX%';
  • Look for sessions with wait_type = XACT_ID_CLEANUP or similar internal cleanup waits.

Step 2: Allow the Cleanup Process to Finish Naturally

  • Do not immediately kill the session; forcibly terminating it can leave the index in an inconsistent state.
  • Monitor progress using:
SELECT session_id, percent_complete, estimated_completion_time 
FROM sys.dm_exec_requests 
WHERE command LIKE '%INDEX%';
  • Wait until percent_complete reaches 100 or the session disappears from the active requests list.

Step 3: Check for Long-Running Open Transactions

  • Long-running transactions on the same table can delay cleanup indefinitely.
  • Run:
DBCC OPENTRAN ('YourDatabaseName');
  • If an old transaction is found holding locks, coordinate with the application team to commit or roll it back safely.

Step 4: Restart the SQL Server Service (Last Resort)

  • If cleanup appears stuck for an extended period (hours) with no progress, restart the SQL Server service via Services.msc on Windows Server 2025 or Windows 11.
  • Path: Control Panel > Administrative Tools > Services > SQL Server (MSSQLSERVER)
  • Right-click and select Restart. Note: this will roll back the incomplete index operation automatically on startup.

Step 5: Re-run the Original Index Operation

  • Once cleanup is confirmed complete, re-issue the original CREATE INDEX, ALTER INDEX, or DROP INDEX statement.
  • Use the ONLINE = ON option again if minimal downtime is required.

Alternative or Verification Steps

  • Verify the fix by re-running the same index command that previously failed; if it completes without Error 689, cleanup has finished successfully.
  • As an alternative, use sys.dm_exec_requests and sys.dm_tran_active_transactions together to confirm no lingering transactions or index build metadata remain before retrying the operation.

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

Troubleshooting Guide: SQL Server Error 691 — “An Internal Error Occurred. Error Code %X”

Why This Error Happens

Error 691 in SQL Server 2025 typically occurs when the SQLDump or internal diagnostic subsystem encounters a corrupted memory allocation, an incompatible resource governor state, or a failure to write to the error log directory due to insufficient NTFS permissions. This is often triggered by a mismatch between the SQL Server service account’s access rights and the target data/log directories on Windows Server 2025, or by a transient hardware-level issue (such as a failing disk sector) that corrupts a system page during a checkpoint operation. In rare cases, this error surfaces after an in-place upgrade when legacy DLLs from a previous SQL Server version remain in the installation path.

Step-by-Step Resolution Guide

Step 1: Verify Service Account Permissions

  • Open Services.msc and confirm the account running “SQL Server (MSSQLSERVER)” matches the account with explicit Full Control on C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\.
  • Run icacls "C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA" in an elevated PowerShell prompt to check current permissions.
  • Grant permissions if missing using: icacls "C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA" /grant "NT SERVICE\MSSQLSERVER:(OI)(CI)F"

Step 2: Check for Corrupted System Databases

  • Restart SQL Server in single-user mode via Command Prompt: NET START MSSQLSERVER /f /T3608
  • Run DBCC CHECKDB ('master') WITH NO_INFOMSGS, ALL_ERRORMSGS; to scan for corruption in the master database.
  • If corruption is found, restore the master database from a known-good backup using SQL Server Management Studio (SSMS) 21.

Step 3: Clear and Rebuild the Error Log Cache

  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\ and rename ERRORLOG to ERRORLOG.old.
  • Restart the SQL Server service via Restart-Service -Name 'MSSQLSERVER' -Force in PowerShell (Admin).
  • Confirm a fresh ERRORLOG file regenerates without immediate Error 691 entries on startup.

Step 4: Update SQL Server Cumulative Update (CU)

  • Check current build version with: SELECT @@VERSION;
  • Download the latest Cumulative Update for SQL Server 2025 from the Microsoft Update Catalog.
  • Apply the update in a maintenance window, ensuring Windows Server 2025 is fully patched via sconfig prior to installation.

Alternative or Verification Steps

  • Verify the fix by running DBCC CHECKDB again immediately after the restart; a clean result with zero allocation errors confirms resolution.
  • If the error persists, use SQL Server Configuration Manager to fully rebuild the instance using setup.exe /ACTION=REBUILDDATABASE as a last-resort alternative.

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

Troubleshooting Guide: Error 685 – Backpointer Retrieval Failure for Heap Forwarded Record

Why This Error Happens

Error 685 occurs when the SQL Server Storage Engine encounters a forwarded record on a heap table but cannot correctly resolve the backpointer linking it to its original forwarding stub. This is almost always indicative of physical page-level corruption caused by faulty I/O subsystems, improperly configured storage caching, or an unexpected server shutdown during a write operation. In rare cases, it can also stem from a SQL Server engine bug when handling concurrent updates on heap tables with forwarded records under heavy fragmentation.

Step-by-Step Resolution Guide

Step 1: Run DBCC CHECKDB to Confirm Corruption Scope

  • Open SQL Server Management Studio (SSMS) or sqlcmd and connect to the affected instance.
  • Execute: DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for allocation errors or consistency errors tied to the specific heap table and page IDs referenced in Error 685.
  • Note the object ID and page number reported alongside the backpointer failure for use in later steps.

Step 2: Validate Storage and I/O Subsystem Integrity

  • On Windows Server 2025/Windows 11, open Event Viewer (eventvwr.msc) and check the System log under Disk and Ntfs sources for I/O warnings around the timestamp of the error.
  • Run wmic diskdrive get status or use Get-PhysicalDisk | Select FriendlyName, HealthStatus in PowerShell to confirm disk health.
  • If using virtualized storage, verify that write-caching policies on the underlying disk controller are set to write-through, not write-back, unless backed by battery/flash protection.

Step 3: Rebuild the Affected Heap Table

  • Since heaps do not support REBUILD directly, create a clustered index on the table temporarily to force a physical reorganization: CREATE CLUSTERED INDEX temp_idx ON dbo.YourTable(YourPrimaryKeyColumn);
  • Drop the temporary clustered index afterward if a heap structure is required: DROP INDEX temp_idx ON dbo.YourTable;
  • This process eliminates orphaned forwarding pointers by rewriting the table’s physical page structure.

Step 4: Restore from a Clean Backup (If Corruption Persists)

  • Navigate to your backup directory (commonly D:\SQLBackups\ or as configured in your maintenance plan).
  • Run: RESTORE DATABASE YourDatabaseName FROM DISK = 'D:\SQLBackups\YourDatabaseName_Full.bak' WITH REPLACE, RECOVERY;
  • Apply any subsequent transaction log backups if point-in-time recovery is required.

Step 5: Apply Latest Cumulative Update for SQL Server 2025

  • Check your current build version: SELECT @@VERSION;
  • Download and install the latest Cumulative Update (CU) from the Microsoft Update Catalog to rule out known heap-handling bugs.
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER after installation.

Alternative or Verification Steps

  • Re-run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; after remediation to confirm zero allocation or consistency errors are returned.
  • If corruption reoccurs frequently on the same LUN or volume, engage your storage vendor to run a full hardware diagnostic, as this points to an underlying disk or controller fault rather than a SQL Server defect.

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

Troubleshooting Guide: Error 686 – Maximum B-Tree Level Reached

Why This Error Happens

Error 686 occurs when an index’s B-Tree structure has grown to its absolute architectural limit of 255 levels, which typically happens on tables with an extremely poor choice of clustering key (such as a highly non-sequential GUID) combined with severe page splitting over time. This is almost always a symptom of index fragmentation left unmanaged for extended periods, causing SQL Server to insert new intermediate levels to accommodate ever-smaller page splits. In rare cases, it can also indicate underlying logical corruption in the index metadata that is miscalculating the tree depth.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Rowset and Object

  • Query sys.dm_db_index_physical_stats with the rowset_id from the error message to map it back to a table and index name.
  • Run the following to correlate the ID: SELECT OBJECT_NAME(object_id), index_id FROM sys.partitions WHERE partition_id = <rowset_id>;
  • Note the index_depth and index_level columns in the physical stats output to confirm you are near or at the 255-level ceiling.

Step 2: Rebuild the Index with a Better Fill Factor

  • Since a simple REORGANIZE will not fix a tree that has hit the ceiling, you must perform a full rebuild.
  • Execute: ALTER INDEX [IX_YourIndexName] ON [dbo].[YourTable] REBUILD WITH (FILLFACTOR = 80, SORT_IN_TEMPDB = ON);
  • If the table is extremely large, run this in ONLINE = ON mode (Enterprise Edition) to avoid extended downtime on Windows Server 2025 production environments.

Step 3: Re-evaluate the Clustering Key Strategy

  • If the rebuild fails or the tree size immediately balloons again, the underlying clustering key design is flawed.
  • Consider changing a random UNIQUEIDENTIFIER (GUID) clustering key to a sequential BIGINT Identity column or use NEWSEQUENTIALID() instead of NEWID().
  • Drop and recreate the clustered index: CREATE CLUSTERED INDEX [CIX_YourTable] ON [dbo].[YourTable] ([NewSequentialColumn]) WITH (DROP_EXISTING = ON);

Step 4: Run a Full Consistency Check

  • Before finalizing the fix, ensure the underlying data pages are not corrupted, as this can sometimes trigger false-positive depth calculations.
  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; on the specific database via SQL Server Management Studio (SSMS) or a PowerShell Invoke-Sqlcmd session.
  • Review the output for any allocation errors that might require a REPAIR_ALLOW_DATA_LOSS flag (use only as a last resort after backups are secured).

Alternative or Verification Steps

  • After the rebuild, re-run the sys.dm_db_index_physical_stats query to confirm the index_level has dropped significantly (ideally back down to single digits).
  • If the error persists immediately after a rebuild, restore the database from the last known good backup taken prior to the fragmentation event, as this indicates a deeper storage-level corruption issue rather than a logical indexing problem.

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

Troubleshooting Guide: SQL Server Error 687 – Cannot Compress nchar/nvarchar Column with Odd Byte Count

Why This Error Happens

Error 687 occurs because SQL Server’s page and row compression algorithms require Unicode (nchar/nvarchar) data to be stored in an even number of bytes, since each Unicode character occupies 2 bytes. When a column contains or is capable of containing an odd byte-length value (often due to legacy data, a collation mismatch, or improper data conversion from a non-Unicode source), the compression engine cannot align the storage format and throws this error. This is typically triggered during a ALTER TABLE ... REBUILD WITH (DATA_COMPRESSION = PAGE/ROW) operation on tables containing malformed or improperly padded Unicode strings.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Column and Data

  • Run a diagnostic query to locate columns using nchar/nvarchar data types on the target table:
  SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH 
  FROM INFORMATION_SCHEMA.COLUMNS 
  WHERE TABLE_NAME = 'YourTableName';
  • Check for rows with odd byte-lengths using DATALENGTH():
  SELECT * FROM YourTableName 
  WHERE DATALENGTH(YourColumnName) % 2 <> 0;
  • Note the primary keys of any offending rows for remediation.

Step 2: Correct the Odd-Byte Data

  • Update the identified rows to force even-byte alignment by re-casting the value:
  UPDATE YourTableName 
  SET YourColumnName = CAST(YourColumnName AS NVARCHAR(MAX)) 
  WHERE DATALENGTH(YourColumnName) % 2 <> 0;
  • If the data originated from a linked server or BCP import, re-import using the -w (wide character) flag to preserve Unicode formatting.
  • Ensure any application-layer inserts use parameterized NVARCHAR types rather than raw byte strings.

Step 3: Rebuild the Index with Compression

  • Once data is corrected, re-attempt the compression command:
  ALTER TABLE YourTableName REBUILD WITH (DATA_COMPRESSION = PAGE);
  • If the table has multiple indexes, rebuild them individually rather than using ALL to isolate any remaining problem indexes.

Step 4: Update SQL Server Cumulative Updates

  • Navigate to Microsoft Update Catalog or use SQL Server Setup on Windows Server 2025 to check for the latest Cumulative Update (CU) for SQL Server 2025.
  • Apply the update via:
  Setup.exe /Action=Patch /IAcceptSQLServerLicenseTerms /Quiet /Instancename=MSSQLSERVER
  • This resolves known edge-case bugs in the Unicode compression handler present in early builds of SQL Server 2025.

Alternative or Verification Steps

  • Verify the fix by querying sys.dm_db_index_physical_stats to confirm the compression_delay and data_compression_desc fields now show PAGE or ROW for the affected index.
  • If the error persists, as a workaround, temporarily convert the affected column to a non-Unicode type (varchar) if the application does not require multi-byte character support, then apply compression before reverting (only if data loss risk is acceptable).

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

Troubleshooting Guide: Error 683 – Decimal Format Conversion Error in SQL Server 2025

Why This Error Happens

Error 683 occurs when SQL Server’s storage engine encounters an internal inconsistency while converting decimal or numeric data between its variable-length (row-overflow/compressed) storage format and its fixed-length in-memory representation. This is typically triggered by page-level corruption in a table or index containing decimal/numeric columns, often caused by faulty storage hardware, improper shutdowns, or a bug in row compression handling. It can also surface after an in-place upgrade where legacy compressed pages contain decimal values that do not conform to the newer storage engine’s expected byte layout.

Step-by-Step Resolution Guide

Step 1: Isolate the Affected Database and Run Integrity Checks

  • Open SQL Server Management Studio (SSMS) or sqlcmd and connect to the instance reporting the error.
  • Run the following command against the suspect database:
  DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for allocation or consistency errors referencing decimal/numeric columns or page IDs.
  • Note any object IDs or page numbers flagged in the results for further action.

Step 2: Check for Storage and Compression-Related Corruption

  • Verify whether the affected table uses ROW or PAGE compression:
  SELECT OBJECT_NAME(object_id), data_compression_desc 
  FROM sys.partitions 
  WHERE object_id = OBJECT_ID('YourTableName');
  • If compression is enabled, temporarily disable it to rule out a compression-decimal conversion conflict:
  ALTER TABLE YourTableName REBUILD WITH (DATA_COMPRESSION = NONE);
  • Check the Windows Event Viewer (Event Viewer > Windows Logs > System) for disk-level warnings (Event ID 51 or 153) that may indicate underlying storage hardware issues.

Step 3: Repair Corrupted Pages or Restore from Backup

  • If DBCC CHECKDB reports corruption, first attempt a minimally invasive repair:
  DBCC CHECKDB ('YourDatabaseName', REPAIR_REBUILD);
  • If corruption persists in decimal-based indexes, drop and rebuild the specific index:
  ALTER INDEX ALL ON YourTableName REBUILD;
  • If repair fails or data loss is reported, restore the database from the last known good backup using:
  RESTORE DATABASE YourDatabaseName FROM DISK = 'C:\Backups\YourDatabaseName.bak' WITH REPLACE;

Step 4: Update SQL Server 2025 to the Latest Cumulative Update

  • Navigate to Windows Update or the SQL Server Installation Center on Windows Server 2025 / Windows 11.
  • Confirm the current build version:
  SELECT @@VERSION;
  • Download and apply the latest Cumulative Update (CU) from the Microsoft Update Catalog, as this error has known fixes tied to decimal serialization bugs in early 2025 builds.
  • Restart the SQL Server service via services.msc after the update completes.

Alternative or Verification Steps

  • After remediation, re-run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; and confirm zero allocation or consistency errors are returned.
  • As an alternative, if corruption reoccurs on the same table, export the data via bcp or SELECT INTO a new table, drop the original, and recreate it with fresh compression settings to eliminate legacy page corruption.

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

Troubleshooting Guide: SQL Server Error 684 – Compression Format Conversion Failure

Why This Error Happens

Error 684 occurs when SQL Server’s storage engine encounters an internal inconsistency while converting a page between row/page compression states and uncompressed formats, typically during operations like ALTER TABLE ... REBUILD or automatic compression maintenance tasks. This is most often triggered by underlying page-level corruption caused by faulty disk I/O, an unexpected storage subsystem failure, or a mismatch in allocation unit metadata. In rarer cases, it stems from a corrupted buffer pool page that was never flushed correctly to disk due to a hardware or filesystem-level write failure.

Step-by-Step Resolution Guide

Step 1: Confirm and Isolate the Corruption

  • Open SQL Server Management Studio (SSMS) or sqlcmd and run: DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for allocation errors, consistency errors, or specific page IDs flagged as corrupt.
  • Note the exact object ID and index ID reported alongside Error 684 in the SQL Server error log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG).

Step 2: Check Storage and Hardware Health

  • Inspect Windows Event Viewer under Windows Logs > System for Disk or NTFS warnings correlating with the SQL error timestamp.
  • Run chkdsk C: /f /r (or the relevant data drive letter) during a scheduled maintenance window to detect and repair filesystem-level issues.
  • Verify that antivirus or backup software is not scanning/locking .mdf/.ndf files while SQL Server is active; exclude the SQL Server data directory (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\) from real-time scanning.

Step 3: Repair the Affected Objects

  • If DBCC CHECKDB reports repairable errors, first attempt a targeted fix: ALTER INDEX [IndexName] ON [SchemaName].[TableName] REBUILD;
  • If the rebuild also fails with Error 684, restore the affected table or database from the last known-good backup rather than forcing repair.
  • As a last resort only, run DBCC CHECKDB('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) in single-user mode, understanding this may delete corrupted rows.

Step 4: Validate Compression Settings Post-Repair

  • Re-run the original compression operation in a controlled test, e.g.: ALTER TABLE [SchemaName].[TableName] REBUILD WITH (DATA_COMPRESSION = PAGE);
  • Monitor the SQL Server error log in real time to confirm Error 684 does not resurface.

Alternative or Verification Steps

  • Run DBCC CHECKDB a second time after remediation to confirm zero allocation and consistency errors are returned.
  • If the error persists after repair and restore attempts, engage Microsoft Support with the ERRORLOG, DBCC CHECKDB output, and a memory dump (if generated) for deeper diagnostic analysis, as recurring Error 684 can indicate a rare storage engine defect requiring a cumulative update or hotfix.

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

Why This Error Happens

Error 680 in SQL Server (“Internal error. Update conflict encountered, cannot proceed”) typically occurs when two or more sessions attempt to update the same row within an indexed view or a table containing a computed column with side effects simultaneously. This is often triggered by non-deterministic functions used in computed columns or persisted views, causing the query optimizer to lose track of row versioning during concurrent writes. It can also surface when filtered indexes reference columns updated through triggers, creating a race condition at the storage engine level.

Step-by-Step Resolution Guide

Step 1: Identify the Conflicting Object

  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS to check for underlying corruption on the table/view.
  • Query sys.indexes and sys.computed_columns to locate any indexed views or computed columns tied to the table referenced in the error message.
  • Check the SQL Server Error Log (%ProgramFiles%\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the exact object ID associated with Error 680.

Step 2: Remove Non-Deterministic Dependencies

  • Open SQL Server Management Studio (SSMS) and script out the definition of the affected indexed view using sp_helptext 'ViewName'.
  • Replace any non-deterministic functions (e.g., GETDATE(), NEWID(), or CLR functions without the IsDeterministic attribute) with deterministic alternatives.
  • Drop and recreate the indexed view:
  DROP INDEX IX_YourView ON dbo.YourView;
  DROP VIEW dbo.YourView;
  • Rebuild the view with WITH SCHEMABINDING and re-create the clustered index.

Step 3: Update SQL Server 2025 Cumulative Update

  • Navigate to the Microsoft Update Catalog and confirm you are on the latest Cumulative Update (CU) for SQL Server 2025.
  • On Windows Server 2025 / Windows 11, run Windows Update or manually execute the downloaded .exe patch as Administrator.
  • Restart the SQL Server service via services.msc or run:
  net stop MSSQLSERVER && net start MSSQLSERVER

Step 4: Adjust Isolation Level Settings

  • If the issue persists under heavy concurrency, disable READ_COMMITTED_SNAPSHOT temporarily to test if optimistic concurrency is the trigger:
  ALTER DATABASE YourDatabaseName SET READ_COMMITTED_SNAPSHOT OFF;
  • Re-enable ALLOW_SNAPSHOT_ISOLATION only after confirming the computed columns and views are fully deterministic.

Alternative or Verification Steps

  • Re-run the original transaction or stored procedure that triggered Error 680 under a single-user connection to confirm the update conflict no longer occurs.
  • If the error persists, use SQL Server Profiler or Extended Events to trace the exact statement and isolation level active at the time of failure, then escalate to Microsoft Support with the trace file attached.

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

Troubleshooting Guide: SQL Server Error 681

Why This Error Happens

Error 681 occurs when an INSERT or UPDATE statement attempts to explicitly assign a NULL value to a column that was defined with a NOT NULL constraint at the schema level. This is typically caused by application code sending incomplete or improperly mapped data, a missing DEFAULT constraint that should have supplied a fallback value, or an ETL/import process pulling source data that contains blank fields where the destination schema demands a mandatory value. The database engine correctly rejects the transaction to preserve data integrity, but the failure will persist until either the incoming data or the schema definition is corrected.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Column and Statement

  • Open the failed query in SQL Server Management Studio (SSMS) and review the full error text; it will explicitly name the table and column violating the constraint.
  • Run the following to confirm the column’s nullability:
  SELECT COLUMN_NAME, IS_NULLABLE, DATA_TYPE 
  FROM INFORMATION_SCHEMA.COLUMNS 
  WHERE TABLE_NAME = 'YourTableName';
  • Cross-reference the application source code or import mapping file to see where the NULL value originates.

Step 2: Correct the Source Data or Application Logic

  • If the NULL is unintentional (e.g., a bug in application code or a missing form validation), patch the application layer to enforce a valid value before submission.
  • For ETL jobs (SSIS packages, BCP, or bulk insert scripts), open the package/configuration and add a Derived Column transformation or ISNULL() wrapper to substitute a default value:
  UPDATE YourTable SET YourColumn = ISNULL(YourColumn, 'DefaultValue') WHERE YourColumn IS NULL;
  • If using command-line tools like bcp on Windows Server 2025, verify the format file (.fmt) correctly maps source fields and does not leave gaps for required columns.

Step 3: Add a Default Constraint (If Business Logic Allows)

  • If it’s acceptable for the column to auto-populate rather than fail, add a DEFAULT constraint via SSMS or T-SQL:
  ALTER TABLE YourTable 
  ADD CONSTRAINT DF_YourColumn DEFAULT ('N/A') FOR YourColumn;
  • This ensures that omitted values (not explicit NULLs) are handled gracefully going forward, though explicit NULL in an INSERT statement will still fail as expected.

Step 4: Test the Corrected Transaction

  • Re-run the original INSERT/UPDATE statement in SSMS or Azure Data Studio on Windows 11 to confirm the transaction now commits successfully.
  • Check SQL Server Error Logs (via EXEC sp_readerrorlog or Event Viewer under Applications and Services Logs > MSSQLSERVER) to confirm Error 681 no longer appears for this table.

Alternative or Verification Steps

  • Run DBCC CHECKCONSTRAINTS('YourTable') to validate that no existing rows violate the NOT NULL constraint after your schema/data fix.
  • If the issue persists across multiple tables, consider temporarily enabling a server-side trace or Extended Events session filtered on error_reported with Error Number = 681 to catch every occurrence in real time and pinpoint the exact application module generating the faulty inserts.

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

Why This Error Happens

Error 682 typically occurs when the internal buffer allocated for reading a column’s data is smaller than the actual data being retrieved, often due to metadata corruption in the system catalog or page-level corruption within the data file. This mismatch can result from a torn page write, a hardware-level disk fault, or improper truncation of variable-length column definitions. In rarer cases, it stems from a SQL Server engine bug related to in-memory OLTP or columnstore index buffer estimation during query execution.

Step-by-Step Resolution Guide

Step 1: Run Immediate Consistency Checks

  • Open SQL Server Management Studio (SSMS) or use sqlcmd to connect to the affected instance.
  • Execute DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to identify the exact page and object causing the buffer mismatch.
  • Review the output for allocation errors, specifically looking for “Msg 8928” or “Msg 8944” which often accompany Error 682.

Step 2: Isolate and Repair the Corrupted Object

  • If DBCC CHECKDB identifies a specific table, attempt to isolate the corruption using DBCC CHECKTABLE('SchemaName.TableName') WITH ALL_ERRORMSGS;.
  • If corruption is confirmed and isolated to non-clustered indexes, drop and rebuild the specific index using ALTER INDEX ALL ON TableName REBUILD; rather than a full repair.
  • Avoid using REPAIR_ALLOW_DATA_LOSS until all other recovery options (such as restoring from a clean backup) have been exhausted.

Step 3: Update SQL Server Cumulative Updates

  • Navigate to the Microsoft Update Catalog and check the current build version of SQL Server 2025 via SELECT @@VERSION;.
  • Apply the latest Cumulative Update (CU) for SQL Server 2025, as this error is frequently patched in updates addressing memory grant miscalculations for wide tables.
  • Restart the SQL Server service via services.msc on Windows Server 2025 to ensure the patch binaries are loaded correctly.

Step 4: Verify Windows Storage and Disk Health

  • Check the Windows Event Viewer under Windows Logs > System for any Disk or NTFS warnings correlating with the timestamp of the SQL error.
  • Run chkdsk C: /f /r (replacing C: with your data drive letter) during a scheduled maintenance window to rule out underlying physical disk corruption affecting the .mdf or .ndf files.

Alternative or Verification Steps

  • Verification: Re-run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS; after the repair; a clean pass with zero allocation errors confirms the buffer/column mismatch has been resolved.
  • Alternative Fix: If corruption persists in system tables, restore the specific database from the last known good backup using RESTORE DATABASE... WITH RECOVERY, as this is safer than forcing a repair on system-level metadata.

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

Troubleshooting Guide: SQL Server Error 677 – Unable to Drop Worktable (Deferred Drop)

Why This Error Happens

This error occurs when SQL Server 2025’s internal engine attempts to drop a temporary worktable (typically used during hash joins, sorts, or spool operations) but the underlying partition is still referenced by another active session or an uncommitted transaction. Rather than blocking the calling process, SQL Server marks the worktable for deferred drop, meaning the cleanup will be handled automatically by a background system thread (Deferred Drop Cleanup) once the resource is no longer in use. This is most commonly triggered by high tempdb contention, long-running transactions holding latches on the worktable’s partition, or a backlog in the ghost cleanup/deferred drop queue. In most cases, this is purely informational and does not indicate corruption or data loss.

Step-by-Step Resolution Guide

Step 1: Confirm This Is Informational and Not Blocking Production

  • Check the SQL Server Error Log (via sp_readerrorlog or SSMS > Management > SQL Server Logs) to confirm Error 677 is logged as Informational and not paired with a more severe error (such as 605 or 823).
  • Run SELECT * FROM sys.dm_os_wait_stats WHERE wait_type LIKE '%TEMPDB%' to check if tempdb waits are elevated.
  • Verify tempdb is not physically full using EXEC sp_spaceused against the tempdb database.

Step 2: Identify and Clear Long-Running Blocking Sessions

  • Run the following query to find sessions holding locks on tempdb objects:
  SELECT session_id, blocking_session_id, wait_type, wait_time, wait_resource
  FROM sys.dm_exec_requests
  WHERE database_id = DB_ID('tempdb');
  • Identify any session with an unusually long wait_time or an open transaction via DBCC OPENTRAN(tempdb).
  • If a specific session is holding the partition, safely terminate it using KILL <session_id> (only after confirming it is not a critical production transaction).

Step 3: Force Deferred Drop Cleanup Manually

  • Trigger tempdb cleanup by running:
  DBCC SHRINKFILE(tempdev, 1) WITH NO_INFOMSGS;
  • Alternatively, restart the SQL Server (MSSQLSERVER) service via services.msc on Windows Server 2025 during a maintenance window — this immediately clears all worktables since tempdb is recreated at every restart.
  • Confirm the tempdb data and log files are located on fast storage (SSD/NVMe) at their default path (e.g., C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Data\) to reduce I/O-related contention that causes drop delays.

Step 4: Increase Tempdb File Count and Pre-size Files

  • Navigate to SSMS > Server Properties > Database Settings, or run:
  ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev, SIZE = 8192MB);
  • Add additional tempdb data files (one per logical CPU core, up to 8) to distribute partition allocation load and reduce contention, using:
  ALTER DATABASE tempdb ADD FILE (NAME = tempdev2, FILENAME = 'C:\TempDBData\tempdev2.ndf', SIZE = 1024MB);

Alternative or Verification Steps

  • After applying the fix, monitor the error log for 24–48 hours to confirm Error 677 no longer recurs; you can also query sys.dm_db_session_space_usage to verify tempdb allocation patterns have normalized.
  • If the message persists despite no performance impact, it can safely be filtered/suppressed in your monitoring tool (e.g., SCOM, SolarWinds) since Microsoft classifies it strictly as informational with “no user action required.”

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

Troubleshooting Guide: SQL Server Error 678 – Active Rowset for Partition ID Found at End of Batch

Why This Error Happens

This error occurs when SQL Server’s storage engine detects that an internal rowset associated with a specific partition ID was left active after a batch of operations completed, which typically points to improper exception handling during a transaction or bulk operation. It commonly surfaces during large index rebuilds, partition switching, or parallel query execution where a session was interrupted (via timeout, network failure, or manual cancellation) without allowing the engine to properly clean up its internal cursors. In some cases, this is also a symptom of underlying corruption in the partitioned table’s metadata or an incompatible driver/client library mishandling connection resets.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Session and Terminate It

  • Open SQL Server Management Studio (SSMS) and navigate to Management > Activity Monitor.
  • Locate the Session ID (SPID) referenced in the error log tied to the partition operation.
  • Run the following to confirm the process is still active:
  SELECT session_id, status, last_request_start_time, blocking_session_id
  FROM sys.dm_exec_requests
  WHERE session_id = <SPID>;
  • If confirmed hung or orphaned, terminate it using:
  KILL <SPID>;

Step 2: Check for Partition-Level Corruption

  • Run DBCC CHECKTABLE against the affected table to rule out index/partition corruption:
  DBCC CHECKTABLE ('YourTableName') WITH ALL_ERRORMSGS, NO_INFOMSGS;
  • Review the SQL Server error log (default path: C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\ERRORLOG) for accompanying corruption warnings (Error 823, 824, or 5180).
  • If corruption is found, restore the affected partition from the last known good backup.

Step 3: Update SQL Server Cumulative Updates and Drivers

  • Confirm your instance is on the latest Cumulative Update (CU) for SQL Server 2025 via SSMS > Help > About.
  • Download and apply the latest CU from the official Microsoft Update Catalog.
  • On the client side, ensure the ODBC Driver or OLE DB Driver used by the application connecting to SQL Server is updated to the latest version compatible with Windows Server 2025 / Windows 11.
  • Restart the SQL Server service after patching:
  Restart-Service -Name MSSQLSERVER -Force

Step 4: Review and Adjust Query Timeout / Batch Settings

  • If the error correlates with long-running batch jobs, increase the command timeout setting in your application’s connection string (e.g., Connection Timeout=60 or higher).
  • For SSIS or scheduled jobs, edit the timeout property in SQL Server Agent > Job Steps > Advanced to allow sufficient completion time before forced termination.

Alternative or Verification Steps

  • Verify the fix: Re-run the original batch/partition operation and monitor sys.dm_exec_requests and the SQL Server error log to confirm Error 678 no longer appears.
  • Alternative solution: If the issue persists after patching and session cleanup, rebuild the affected partitioned index entirely using ALTER INDEX ... REBUILD PARTITION = ALL to force SQL Server to regenerate clean rowset metadata.

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

Troubleshooting Guide: SQL Server Error 679 – Filegroup Offline

Why This Error Happens

This error occurs when SQL Server 2025 attempts to access a partitioned index or table whose underlying filegroup has been marked OFFLINE, often due to a missing, corrupted, or inaccessible data file (.ndf/.mdf). It commonly happens after an unexpected storage disconnect, a failed autogrow operation on Windows Server 2025 storage volumes, or when a database was restored without all associated filegroup files present. Until the filegroup is brought back ONLINE and its files are verified as accessible, any partition mapped to that filegroup will remain unreadable.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Filegroup and File Path

  • Run the following query to confirm the filegroup status:
SELECT name, type_desc, state_desc FROM sys.database_files;
  • Cross-reference the filegroup name from the error message with sys.filegroups to confirm which physical file is impacted.
  • Check the file path (commonly under C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\) to see if the .ndf file still exists.

Step 2: Verify Storage and File Permissions

  • Open File Explorer or PowerShell on Windows Server 2025 and confirm the drive/volume hosting the .ndf file is mounted and online:
Get-Disk | Where-Object {$_.OperationalStatus -ne 'Online'}
  • Ensure the SQL Server service account (e.g., NT Service\MSSQLSERVER) has Read/Write permissions on the folder containing the data file.
  • If the disk was disconnected (common in VM or SAN-based Windows Server 2025 deployments), reattach it via Disk Management and bring it online.

Step 3: Bring the Filegroup Back Online

  • If the file exists and permissions are correct, attempt to bring the filegroup online manually:
ALTER DATABASE [YourDatabaseName] 
MODIFY FILEGROUP [YourFilegroupName] ONLINE;
  • If the file is missing or corrupted, restore it from the most recent full or differential backup using RESTORE DATABASE ... WITH FILE targeting only the affected filegroup.

Step 4: Restart SQL Server Service (If Needed)

  • If the filegroup still shows OFFLINE after remediation, restart the SQL Server service via SQL Server Configuration Manager.
  • This forces SQL Server to re-read the file metadata and re-attempt mounting all filegroups at startup.

Alternative or Verification Steps

  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to confirm no further corruption exists on the affected filegroup.
  • If the file is permanently lost and no backup is available, consider recreating the filegroup and re-populating the partitioned data from an alternate replicated source (e.g., Always On secondary).

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

Troubleshooting Guide: SQL Server Error 675 – Worktable Drop Retry Warning

Why This Error Happens

Error 675 is raised when SQL Server 2025’s tempdb engine encounters contention while attempting to deallocate a worktable partition, typically due to a lingering latch or lock held by a concurrent session, parallel query operator, or spill-to-disk operation. This is most commonly triggered by tempdb I/O bottlenecks, insufficient tempdb file pre-allocation, or outdated storage drivers causing delayed page cleanup on Windows Server 2025 / Windows 11 NTFS volumes. While the operation ultimately succeeds after retries, the repeated attempts indicate underlying resource pressure that can degrade performance if left unaddressed.

Step-by-Step Resolution Guide

Step 1: Verify Tempdb Configuration and File Layout

  • Open SQL Server Management Studio (SSMS) and run EXEC sp_helpdb tempdb; to confirm file count matches the number of logical CPU cores (up to 8).
  • Ensure all tempdb data files are equally sized and located on a dedicated, low-latency SSD volume (e.g., T:\TempDB\).
  • Check for autogrowth events using sys.dm_io_virtual_file_stats — frequent growth events indicate undersized initial allocation.

Step 2: Update Storage and Filter Drivers

  • Navigate to Device Manager on Windows Server 2025 / Windows 11 and confirm the storage controller driver is current (check vendor site, e.g., Dell/HPE/Intel VROC).
  • Run Get-PhysicalDisk | Get-StorageReliabilityCounter in PowerShell to rule out latency or read/write error spikes on the tempdb disk.
  • Reboot after driver updates to ensure the new filter driver stack is loaded before SQL Server restarts.

Step 3: Increase Tempdb Contention Relief Settings

  • In SSMS, right-click the server instance, select Properties > Database Settings, and confirm “Model” database growth settings aren’t inherited incorrectly by tempdb.
  • Enable Trace Flag 1118 equivalent behavior (default in SQL Server 2016+) by verifying ALTER DATABASE tempdb SET MIXED_PAGE_ALLOCATION OFF; is applied.
  • Increase max worker threads only if sys.dm_os_wait_stats shows THREADPOOL waits correlating with the 675 events.

Step 4: Monitor and Capture Extended Events

  • Create an Extended Events session filtering on error_reported with error_number = 675 to capture the exact query and session context.
  • Cross-reference captured sql_text with sys.dm_exec_query_stats to identify the specific worktable-generating query (often hash joins, spools, or sort operations).
  • Adjust or rewrite the offending query to reduce worktable spill (e.g., add missing indexes, update statistics).

Alternative or Verification Steps

  • Re-run the workload under load and check the SQL Server Error Log for absence of Error 675 entries over a 24-hour monitoring window.
  • If the issue persists, failover to a secondary replica (if using Always On Availability Groups) and rebuild tempdb from scratch using ALTER DATABASE tempdb MODIFY FILE to reset file paths and sizes.

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

Troubleshooting Guide: SQL Server Error 676 — Failure While Dropping Worktable

Why This Error Happens

Error 676 occurs when SQL Server 2025’s storage engine encounters a problem while attempting to deallocate and drop a temporary worktable during query execution, typically caused by tempdb corruption, insufficient disk space, or an inconsistent state in the partition metadata. This often surfaces during complex hash joins, sort operations, or spool operations that rely on internal worktables, where the engine cannot properly clean up the underlying partition due to I/O failures or abrupt interruptions (such as a killed session or forced failover). In some cases, underlying storage subsystem issues on Windows Server 2025 (e.g., disk latency, filesystem errors on NTFS/ReFS volumes) prevent the deallocation page from being updated correctly.

Step-by-Step Resolution Guide

Step 1: Check tempdb Health and Consistency

  • Run DBCC CHECKDB (tempdb) WITH NO_INFOMSGS, ALL_ERRORMSGS; to identify corruption in system pages or allocation units.
  • Review the SQL Server error log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for accompanying messages (e.g., Error 823, 824, or 825) that indicate I/O subsystem failures.
  • If corruption is confirmed, restart the SQL Server service to force tempdb to be recreated from scratch, since tempdb is not persisted across restarts.

Step 2: Verify Disk Space and Storage Subsystem

  • Confirm the volume hosting tempdb data/log files (commonly T:\TempDB\ or similar) has sufficient free space — a minimum of 20-30% free is recommended.
  • Use Windows Server 2025’s Event Viewer (Windows Logs > System) to check for Disk or ntfs/ReFS warnings correlating with the timestamp of Error 676.
  • Run chkdsk T: /f /r (replace T: with your tempdb drive letter) during a maintenance window to repair filesystem-level inconsistencies.

Step 3: Review and Adjust tempdb Configuration

  • Ensure tempdb has multiple data files (ideally matching the number of logical CPU cores, up to 8) to reduce contention on the same partition/page.
  • Navigate to SQL Server Management Studio (SSMS) > Server Properties > Database Settings, or run:
  ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev, SIZE = 8192MB, FILEGROWTH = 512MB);
  • Restart the SQL Server service via services.msc or Restart-Service MSSQLSERVER in PowerShell to apply file changes.

Step 4: Update SQL Server 2025 Cumulative Update

  • Check the currently installed build number with SELECT @@VERSION;.
  • Download and apply the latest Cumulative Update (CU) from the Microsoft Update Catalog, as worktable deallocation bugs are frequently patched in maintenance releases.
  • Reboot Windows Server 2025 after installation to ensure all binaries and drivers are properly refreshed.

Alternative or Verification Steps

  • Re-run the original query or workload that triggered Error 676 and monitor the SQL Server error log for recurrence; also execute DBCC CHECKDB (tempdb) post-fix to confirm zero allocation errors.
  • If the error persists after the above steps, fail over to a secondary replica (if using Always On Availability Groups) or restore SQL Server from a known-good backup, then engage Microsoft Support with the generated memory dump (.mdmp) files located in the LOG directory for deeper diagnostic analysis.

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

Troubleshooting Guide: SQL Server Error 672 – Failed to Queue Cleanup Packets for Orphaned Rowsets

Why This Error Happens

This error occurs when SQL Server’s background ghost cleanup process is unable to allocate worker threads or memory to process deferred deallocation of orphaned rowsets, typically due to resource contention or an overloaded scheduler. It can also stem from a corrupted or inconsistent internal metadata state in the database (e.g., after a crash, improper shutdown, or version upgrade) that prevents the cleanup manager from correctly identifying rowset ownership. In rare cases, this is triggered by disk I/O subsystem delays or antivirus/filter driver interference blocking the internal queuing mechanism used by SQL Server’s Deferred Drop feature.

Step-by-Step Resolution Guide

Step 1: Check SQL Server Error Log and System Resources

  • Open SQL Server Management Studio (SSMS) and navigate to Management > SQL Server Logs.
  • Search for Error 672 entries and note the timestamp and associated database name.
  • Cross-reference Windows Event Viewer (Applications and Services Logs > MSSQLSERVER) for correlating memory pressure or I/O warnings.
  • Run the following query to check for active memory pressure:
  SELECT * FROM sys.dm_os_memory_clerks WHERE type = 'MEMORYCLERK_SQLGENERAL';

Step 2: Restart the Affected Database or SQL Server Instance

  • Since the error message explicitly states cleanup will retry on database restart, take the database offline and bring it back online:
  ALTER DATABASE [YourDBName] SET OFFLINE WITH ROLLBACK IMMEDIATE;
  ALTER DATABASE [YourDBName] SET ONLINE;
  • Alternatively, restart the full SQL Server service via Services.msc or PowerShell:
  Restart-Service -Name 'MSSQLSERVER' -Force

Step 3: Run DBCC CHECKDB to Rule Out Corruption

  • Execute an integrity check against the affected database to confirm no underlying page-level corruption exists:
  DBCC CHECKDB ('YourDBName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is found in system metadata (e.g., allocation units), plan for REPAIR_ALLOW_DATA_LOSS only as a last resort after a full backup.

Step 4: Exclude SQL Server Data Files from Antivirus/Filter Drivers

  • Navigate to your antivirus console and exclude the following paths:
  • C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA\
  • C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\
  • Confirm no third-party backup or replication filter drivers are locking .mdf/.ldf files during the cleanup window.

Step 5: Increase Worker Thread Availability

  • If the server is under heavy concurrent load, check current worker thread usage:
  SELECT scheduler_id, current_tasks_count, runnable_tasks_count 
  FROM sys.dm_os_schedulers WHERE status = 'VISIBLE ONLINE';
  • Adjust the Max Worker Threads setting in SSMS under Server Properties > Processors if thread starvation is confirmed (default 0 = auto-configure is usually sufficient, but validate against your CPU core count).

Alternative or Verification Steps

  • After restarting the database, re-check the SQL Server log for recurrence of Error 672; if it does not reappear within one cleanup cycle (typically a few minutes), the issue is resolved.
  • Run sp_spaceused on the affected database to confirm no abnormal unallocated space remains, indicating the orphaned rowsets were successfully cleaned up.

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

Troubleshooting Guide: Error 673 – Failure to Access Row Object in Snapshot Isolation

Why This Error Happens

Error 673 occurs when SQL Server encounters memory corruption or an inconsistency while attempting to access a row version in the version store under snapshot isolation. This is typically caused by faulty physical memory (RAM), a corrupted buffer pool page, or an unstable storage subsystem returning inconsistent data during row-versioning operations. In rarer cases, it can result from a bug or resource exhaustion in tempdb, where version store data is maintained.

Step-by-Step Resolution Guide

Step 1: Run Hardware and Memory Diagnostics

  • Open Windows Memory Diagnostic on Windows Server 2025 / Windows 11 by running mdsched.exe and selecting “Restart now and check for problems.”
  • Check the Windows Event Viewer under Windows Logs > System for WHEA-Logger errors, which indicate hardware-level memory or CPU faults.
  • If using a hypervisor (Hyper-V), verify host-level memory integrity and disable Dynamic Memory ballooning for the SQL Server VM temporarily.

Step 2: Validate Database and Tempdb Integrity

  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to detect and repair any corruption in the affected database.
  • Execute DBCC CHECKDB('tempdb') since the version store for snapshot isolation resides in tempdb, and corruption there directly causes Error 673.
  • Review the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for accompanying messages that reference specific page IDs or file corruption.

Step 3: Reconfigure Tempdb and Isolation Settings

  • Ensure tempdb has adequate space and multiple data files (one per logical CPU core, up to 8) to reduce contention and version store pressure.
  • Temporarily disable snapshot isolation on the affected database using: ALTER DATABASE YourDatabaseName SET ALLOW_SNAPSHOT_ISOLATION OFF;
  • Re-enable it after confirming stability: ALTER DATABASE YourDatabaseName SET ALLOW_SNAPSHOT_ISOLATION ON;

Step 4: Apply Latest SQL Server 2025 Cumulative Update

  • Navigate to the Microsoft Update Catalog and download the latest Cumulative Update (CU) for SQL Server 2025.
  • Install the update in a maintenance window, as CUs often contain fixes for row-versioning and buffer pool defects.
  • Restart the SQL Server service via SQL Server Configuration Manager after installation completes.

Alternative or Verification Steps

  • Re-run the workload or query that originally triggered Error 673 and monitor the SQL Server Error Log for recurrence over a 24–48 hour period.
  • If the error persists after hardware and integrity checks pass clean, restore the affected database from a known-good backup and re-test under snapshot isolation to rule out residual corruption.

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

Troubleshooting Guide: SQL Server Error 674 (RowsetNewSS Destructor Exception)

Why This Error Happens

Error 674 occurs when SQL Server’s storage engine encounters an unhandled C++ exception while attempting to destroy a RowsetNewSS object, typically during the cleanup phase of a bulk-insert operation. This is most commonly triggered by corrupted or fragmented pre-allocated disk extents that the engine cannot properly deallocate, often due to underlying storage I/O failures, antivirus interference on data files, or a mismatch between the database’s expected allocation map and actual disk state. In rare cases, outdated storage drivers or filesystem-level corruption on Windows Server 2025/Windows 11 volumes hosting the .mdf/.ndf files can also trigger this fault.

Step-by-Step Resolution Guide

Step 1: Verify Disk and Storage Health

  • Open Event Viewer (eventvwr.msc) and check the System log for Disk or Ntfs warnings correlating with the SQL error timestamp.
  • Run chkdsk D: /f /r (replace D: with your data drive letter) during a maintenance window to repair filesystem-level corruption.
  • Confirm the storage controller drivers are up to date via Device Manager or vendor firmware tools.

Step 2: Run Database Consistency Checks

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Execute DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to detect allocation or page-level corruption.
  • If errors are returned, review recommended repair levels before proceeding (avoid REPAIR_ALLOW_DATA_LOSS unless a backup is confirmed).

Step 3: Exclude SQL Server Files from Antivirus/Defender Scanning

  • Navigate to Windows Security > Virus & threat protection > Manage settings > Exclusions.
  • Add exclusions for C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA\ (adjust path/version as needed) and the sqlservr.exe process.
  • Restart the SQL Server (MSSQLSERVER) service via services.msc to apply changes cleanly.

Step 4: Adjust Bulk-Insert Batch Configuration

  • Reduce the BATCHSIZE parameter in your BULK INSERT or bcp commands to lower memory/disk pressure during large imports.
  • Ensure TABLOCK and ROWS_PER_BATCH hints are set appropriately to avoid excessive pre-allocation of extents in a single transaction.

Step 5: Restart the SQL Server Service (Temporary Fix)

  • As advised in the error message, restart the instance: net stop MSSQLSERVER && net start MSSQLSERVER.
  • Monitor the SQL Server Error Log (ERRORLOG file in the LOG directory) immediately after restart to confirm the exception does not recur during the next bulk operation.

Alternative or Verification Steps

  • Re-run the same bulk-insert operation that originally triggered Error 674 and monitor sys.dm_exec_requests for wait types like PREEMPTIVE_OS_WRITEFILEGATHER to confirm disk I/O is no longer stalling.
  • If the error persists after all steps, restore the affected database from the last known-good backup to a test instance and re-attempt the bulk load to isolate whether the issue is data-specific or environment-specific.

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

SQL Server 2025 Error 669: “The Row Object Is Inconsistent” Troubleshooting Guide

Why This Error Happens

Error 669 typically occurs when SQL Server’s Storage Engine detects a mismatch between an in-memory row structure and its corresponding on-disk page representation, often due to corrupted data pages or interrupted I/O writes. This can happen after unexpected server shutdowns, faulty storage drivers, or corruption introduced during heavy concurrent DML operations on Windows Server 2025. In-Memory OLTP (Hekaton) tables are particularly susceptible if the underlying checkpoint files become desynchronized with the transaction log.

Step-by-Step Resolution Guide

Step 1: Run DBCC CHECKDB to Assess Corruption

  • Open SQL Server Management Studio (SSMS) or sqlcmd and connect to the affected instance.
  • Execute: DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for allocation or consistency errors tied to the specific table/page mentioned in the error log.

Step 2: Check Windows Storage and Driver Health

  • Navigate to Event Viewer > Windows Logs > System and filter for Disk or Storport warnings around the timestamp of Error 669.
  • Run chkdsk C: /f /r (or the relevant volume letter hosting your .mdf/.ndf files) via an elevated Command Prompt, scheduling a restart if required.
  • Update storage controller drivers through Windows Update or the vendor’s utility to rule out I/O-level corruption.

Step 3: Rebuild Affected Indexes or Restore from Backup

  • If corruption is isolated to a single table, run: ALTER INDEX ALL ON YourTableName REBUILD;
  • For persistent corruption, use DBCC CHECKDB('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) only as a last resort in single-user mode.
  • If data integrity is critical, restore the affected database from the last known good backup using RESTORE DATABASE YourDatabaseName FROM DISK = 'YourBackupPath.bak' WITH RECOVERY;

Step 4: Validate Hekaton (In-Memory OLTP) Configuration

  • If the affected table uses In-Memory OLTP, verify the memory-optimized filegroup path under Database Properties > Filegroups in SSMS.
  • Ensure the checkpoint file pairs (CFP) are not orphaned by running: SELECT * FROM sys.dm_db_xtp_checkpoint_files;

Alternative or Verification Steps

  • Re-run the original query that triggered Error 669; if it completes without exception, the inconsistency has been resolved.
  • As an alternative, export the affected table’s data via bcp or SSIS to a new table structure and swap it in, bypassing the corrupted row object entirely.

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

Troubleshooting Guide: SQL Server Error 670 – LOB Data on Offline Filegroup

Why This Error Happens

This error occurs when a table’s Large Object (LOB) data—such as TEXT, IMAGE, VARCHAR(MAX), or XML columns—is physically stored on a filegroup that has been marked OFFLINE, corrupted, or is otherwise inaccessible to the SQL Server 2025 engine. This typically happens after an incomplete restore, a detached data file that wasn’t reattached properly, or a storage/disk failure that caused Windows Server 2025 to lose the volume mapping to the .ndf file. Because LOB pages are not stored inline with the row data, the engine cannot bypass the offline filegroup even if the primary data resides elsewhere.

Step-by-Step Resolution Guide

Step 1: Identify the Offline Filegroup and Associated Files

  • Run the following query to locate the affected filegroup and its physical file path:
  SELECT name, physical_name, state_desc 
  FROM sys.master_files 
  WHERE database_id = DB_ID('YourDatabaseName');
  • Cross-reference the %.*ls filegroup name from the Error 670 message with the FILEGROUP_NAME() output in sys.filegroups.

Step 2: Verify Physical File Availability on Disk

  • Navigate to the expected file path (commonly C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\) and confirm the .ndf file physically exists.
  • Check Windows Server 2025 Disk Management to ensure the underlying volume (especially if using Storage Spaces Direct or a SAN-mounted drive) is online and not in a “Reserved” or “Offline” state.
  • If the disk is offline, bring it online via PowerShell:
  Get-Disk | Where-Object IsOffline -Eq $true | Set-Disk -IsOffline $false

Step 3: Bring the Filegroup Back Online

  • If the file exists and the disk is healthy, attempt to bring the filegroup back online using T-SQL:
  ALTER DATABASE YourDatabaseName 
  MODIFY FILEGROUP YourFileGroupName ONLINE;
  • If the file is missing or the path changed, remap it before setting it online:
  ALTER DATABASE YourDatabaseName 
  MODIFY FILE (NAME = LogicalFileName, FILENAME = 'D:\SQLData\NewPath\file.ndf');

Step 4: Restore from Backup if Files Are Corrupted

  • If the .ndf file is corrupted beyond repair, perform a file-level or filegroup-level restore:
  RESTORE DATABASE YourDatabaseName 
  FILEGROUP = 'YourFileGroupName' 
  FROM DISK = 'E:\Backups\YourDatabase_FG.bak' 
  WITH NORECOVERY;
  • Follow with a transaction log restore and WITH RECOVERY to bring the database to a consistent state.

Alternative or Verification Steps

  • Re-run SELECT * FROM YourTable WHERE LOB_Column IS NOT NULL; to confirm LOB data is now readable without triggering Error 670.
  • If the filegroup cannot be recovered, use DBCC CHECKDB with the REPAIR_ALLOW_DATA_LOSS option only as a last resort, as this may permanently remove inaccessible LOB pages.

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

Why This Error Happens

Error 671 occurs when a data modification statement (INSERT, UPDATE, or DELETE) attempts to write to a table whose LOB data—such as TEXT, NTEXT, IMAGE, VARCHAR(MAX), NVARCHAR(MAX), VARBINARY(MAX), or XML columns—is physically stored on a filegroup that has been marked READ_ONLY. SQL Server 2025 blocks the write operation at the storage engine level because the underlying data pages cannot be modified while the filegroup is in this state. This typically happens after a filegroup is intentionally set to read-only for archival purposes, or unintentionally left read-only following a database restore, log-shipping failover, or Always On secondary replica promotion.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Filegroup and Table

  • Run the following query to confirm which filegroup holds the LOB data:
  SELECT t.name AS TableName, fg.name AS FilegroupName, fg.is_read_only
  FROM sys.tables t
  JOIN sys.indexes i ON t.object_id = i.object_id
  JOIN sys.filegroups fg ON i.data_space_id = fg.data_space_id
  WHERE t.name = 'YourTableName';
  • Confirm is_read_only = 1 for the filegroup in question.

Step 2: Verify Why the Filegroup Is Read-Only

  • Check if this is an intentional archival configuration (common in Stretch or tiered storage setups) or an unintended state from a recent restore/failover.
  • On Windows Server 2025, confirm the underlying disk/volume isn’t mounted as read-only (Disk Management → Properties → check volume attributes) if the issue is storage-level rather than SQL-level.
  • Review SQL Server error logs (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for prior ALTER DATABASE commands affecting the filegroup.

Step 3: Set the Filegroup Back to Read-Write

  • Open SQL Server Management Studio (SSMS) or a query window with sysadmin privileges.
  • Execute:
  ALTER DATABASE [YourDatabaseName]
  MODIFY FILEGROUP [YourFilegroupName] READWRITE;
  • Ensure no other sessions hold exclusive locks on the database that could block the ALTER DATABASE command; if blocked, check sys.dm_exec_requests for blocking session IDs.

Step 4: Re-Run the Original Data Modification Statement

  • Retry the INSERT/UPDATE/DELETE operation that originally triggered Error 671.
  • If the operation succeeds without error, the filegroup state was the root cause.

Step 5: Re-Apply Read-Only Status If Required (Optional)

  • If the filegroup was intentionally read-only for compliance/archival reasons, switch it back after completing necessary writes:
  ALTER DATABASE [YourDatabaseName]
  MODIFY FILEGROUP [YourFilegroupName] READONLY;
  • Document this filegroup’s state in your maintenance runbook to prevent future confusion.

Alternative or Verification Steps

  • Verify the fix by querying sys.filegroups again and confirming is_read_only = 0, then execute a test write against the LOB column to ensure Error 671 no longer appears.
  • If ALTER DATABASE fails due to active connections, use ALTER DATABASE [YourDatabaseName] SET SINGLE_USER WITH ROLLBACK IMMEDIATE before modifying the filegroup, then revert to MULTI_USER afterward.

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

Troubleshooting Guide: SQL Server Error 664 – Logical Revert on Readable Secondary

Why This Error Happens

This error occurs because a write-dependent operation—typically involving version store cleanup, deferred transaction rollback, or a logical revert of an update—is being attempted against an Always On Availability Group readable secondary replica. Readable secondaries are read-only by design, and certain internal operations (such as reverting a logical update to a page in the version store, often tied to online index rebuilds or snapshot isolation transactions on the primary) cannot be replicated or executed on a secondary. This typically surfaces when a long-running read query on the secondary conflicts with redo operations coming from the primary, forcing SQL Server to abort the query rather than allow an inconsistent state.

Step-by-Step Resolution Guide

Step 1: Identify the Conflicting Query and Session

  • Run SELECT * FROM sys.dm_exec_requests WHERE command LIKE '%SELECT%' on the secondary replica to find long-running read queries.
  • Cross-reference with sys.dm_hadr_database_replica_states to confirm the affected database is in a readable secondary role.
  • Check the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the exact timestamp and database name tied to Error 664.

Step 2: Adjust Redo Queue and Snapshot Isolation Settings

  • Increase REDO_QUEUE throughput by checking sys.dm_hadr_database_replica_states for redo_queue_size growth, which increases contention with long-running reads.
  • Lower the transaction isolation level on the secondary query if possible—avoid SNAPSHOT isolation on very long scans against tables undergoing heavy writes on the primary.
  • If using Read-Only Routing, set MAX_READONLY_LAG_PER_REPLICA conservatively via ALTER AVAILABILITY GROUP [AGName] MODIFY REPLICA ON N'SecondaryNode' WITH (SECONDARY_ROLE (READ_ONLY_ROUTING_URL = 'TCP://SecondaryNode:1433')).

Step 3: Reconfigure or Reschedule Conflicting Workloads

  • Move heavy analytical or reporting queries to a dedicated reporting replica if multiple secondaries exist, isolating them from replicas under heavy redo pressure.
  • Use Resource Governor to throttle long-running SELECT statements: CREATE WORKLOAD GROUP [ReadOnlyReports] WITH (MAX_DOP = 4) on the secondary instance.
  • Schedule index maintenance and large batch updates on the primary during low-read windows to reduce the frequency of logical reverts propagating to secondaries.

Step 4: Update SQL Server 2025 Cumulative Updates

  • Navigate to Microsoft Update Catalog and confirm the instance is patched to the latest Cumulative Update for SQL Server 2025, since redo/version-store conflict handling on readable secondaries has known fixes in recent builds.
  • Verify version with SELECT @@VERSION and compare against the latest CU release notes.

Alternative or Verification Steps

  • Re-run the previously failing report/query on the secondary and confirm it completes without Error 664 while simultaneously monitoring redo_queue_size in sys.dm_hadr_database_replica_states to ensure it stays low.
  • If the error persists, consider failing over the Availability Group temporarily to rule out node-specific corruption, or route the affected read-only workload directly to the primary replica as a short-term workaround.

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

Troubleshooting Guide: SQL Server Error 666 – Maximum System-Generated Unique Value Exceeded

Why This Error Happens

This error occurs when the internal “uniquifier” value—a hidden 4-byte column SQL Server adds to non-unique clustered indexes to distinguish duplicate key rows—reaches its maximum threshold within a specific partition. This typically happens on tables with a non-unique clustered index that receives extremely high volumes of duplicate key inserts and deletes over time, causing the uniquifier counter to exhaust its range without the space being reclaimed. It is a logical/structural limitation of the index rather than a sign of physical corruption, though it prevents further inserts of duplicate values into that partition.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Table and Partition

  • Run the following query to translate the partition ID from the error message into a table/index name:
  • SELECT OBJECT_NAME(object_id) AS TableName, index_id, partition_number FROM sys.partitions WHERE partition_id = <PartitionIDFromError>;
  • Confirm whether the index is clustered and non-unique, as this is the root condition for the uniquifier exhaustion.

Step 2: Rebuild the Index to Reset the Uniquifier

  • Open SQL Server Management Studio (SSMS) or a query window connected to the SQL Server 2025 instance.
  • Execute a rebuild command targeting the specific index (replace placeholders accordingly):
  • ALTER INDEX [IndexName] ON [SchemaName].[TableName] REBUILD;
  • If the table is heavily partitioned, rebuild only the affected partition using ALTER INDEX ... REBUILD PARTITION = <PartitionNumber>; to reduce downtime.
  • Ensure sufficient free disk space in the data drive (typically C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA) since rebuilds require additional temporary space.

Step 3: Convert the Index to Enforce Uniqueness (Long-Term Fix)

  • Evaluate whether the clustered index key can be modified to be truly unique, eliminating the need for a uniquifier entirely.
  • Add a unique constraint or an additional column (such as an identity column) to the clustered key:
  • ALTER TABLE [SchemaName].[TableName] DROP CONSTRAINT [OldPK];
  • ALTER TABLE [SchemaName].[TableName] ADD CONSTRAINT [PK_New] PRIMARY KEY CLUSTERED ([Column1], [IdentityColumn]);
  • Test this change in a staging environment first, as altering primary keys can affect foreign key relationships and application logic.

Step 4: Monitor and Set Up Alerts for Future Recurrence

  • Use SQL Server Agent to create a scheduled job that checks sys.dm_db_index_physical_stats weekly for index health on high-duplicate-value tables.
  • Configure an alert on Error 666 via SQL Server Agent Alerts (Object Explorer → SQL Server Agent → Alerts → New Alert → Error Number 666) so the DBA team is notified before the issue recurs.

Alternative or Verification Steps

  • After rebuilding, verify the fix by re-running the original INSERT/UPDATE operation that triggered the error, and confirm no Error 666 is raised in the SQL Server Error Log (Event Viewer → Windows Logs → Application or sys.messages/ERRORLOG file).
  • If rebuilding does not resolve the issue (e.g., due to extreme data skew), consider dropping and recreating the index entirely with DROP INDEX followed by CREATE CLUSTERED INDEX, ensuring you rebuild any dependent nonclustered indexes afterward.

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

Troubleshooting Guide: SQL Server Error 667 – Filegroup Offline

Why This Error Happens

This error occurs because the specific filegroup containing the requested index or table data has been marked OFFLINE, preventing SQL Server 2025 from accessing the underlying data pages. This typically results from a database file being moved, deleted, or corrupted, or from an incomplete restore/recovery process that failed to bring all files back online. Additionally, disk-level issues such as I/O errors or storage disconnection on Windows Server 2025 can trigger SQL Server to automatically take the filegroup offline to prevent data corruption.

Step-by-Step Resolution Guide

Step 1: Verify the Current State of the Filegroup and Files

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Run the following query to check file and filegroup status:
  SELECT name, state_desc, physical_name 
  FROM sys.master_files 
  WHERE database_id = DB_ID('YourDatabaseName');
  • Look for state_desc values like OFFLINE or RECOVERY_PENDING.

Step 2: Check Physical File Accessibility on Disk

  • Navigate to the default data directory, typically located at:
    C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\
  • Confirm the .ndf or .mdf file associated with the offline filegroup physically exists and is not corrupted or renamed.
  • If the file was moved to a different drive (e.g., due to storage migration in Windows Server 2025), update the file path using:
  ALTER DATABASE YourDatabaseName 
  MODIFY FILE (NAME = LogicalFileName, FILENAME = 'D:\NewPath\FileName.ndf');

Step 3: Bring the Filegroup Back Online

  • If the file is present and accessible, attempt to bring the filegroup back online with:
  ALTER DATABASE YourDatabaseName 
  MODIFY FILEGROUP YourFilegroupName ONLINE;
  • If the underlying file is missing or unrecoverable, restore the specific file from a recent backup using:
  RESTORE DATABASE YourDatabaseName 
  FILE = 'LogicalFileName' 
  FROM DISK = 'D:\Backups\YourBackup.bak' 
  WITH NORECOVERY;

Step 4: Check Windows-Level Storage and Permissions

  • Open Disk Management or Storage Spaces on Windows Server 2025 to ensure the volume hosting the data file is mounted and online.
  • Verify the SQL Server Service Account has Read/Write NTFS permissions on the data folder via File Explorer > Properties > Security.

Alternative or Verification Steps

  • Verification: Re-run the sys.master_files query from Step 1; the state_desc column should now display ONLINE for the affected filegroup.
  • Alternative: If the file is unrecoverable and no backup exists, you may need to run DBCC CHECKDB with the REPAIR_ALLOW_DATA_LOSS option as a last resort, though this may result in the permanent loss of data associated with that specific filegroup.

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

Troubleshooting Guide: SQL Server Error 658

Why This Error Happens

Error 658 occurs when SQL Server 2025 cannot enable a specific feature (such as memory-optimized tables, change tracking, or a similar database-level capability) because a prerequisite condition inside the database is not met. This is commonly caused by the database being in an incompatible state — such as being in SINGLEUSER mode, having an incompatible compatibility level, missing a required filegroup (like a MEMORYOPTIMIZEDDATA filegroup), or the requesting account lacking sufficient permissions (ALTER, CONTROL, or dbowner rights). Additionally, corrupted system catalog metadata or a database still marked as “in recovery” can prevent the feature flag from being written successfully.

Step-by-Step Resolution Guide

Step 1: Verify Database State and Compatibility Level

  • Open SQL Server Management Studio (SSMS) or Azure Data Studio and run:
  • SELECT state_desc, compatibility_level FROM sys.databases WHERE name = 'YourDatabaseName';
  • Ensure the state is ONLINE and not RESTORING, RECOVERY_PENDING, or SUSPECT.
  • If the compatibility level is below 130 (SQL Server 2016), update it using:
  • ALTER DATABASE YourDatabaseName SET COMPATIBILITY_LEVEL = 170;

Step 2: Check and Correct Multi-User Access Mode

  • Confirm the database isn’t stuck in SINGLE_USER mode, which can block feature enablement scripts from completing.
  • Run: ALTER DATABASE YourDatabaseName SET MULTI_USER;
  • If the database is locked by another session, first identify blocking sessions using sp_who2 and kill the offending SPID with KILL <SPID>;.

Step 3: Validate Required Filegroup or Feature Prerequisite

  • If the error references memory-optimized objects, confirm a MEMORY_OPTIMIZED_DATA filegroup exists:
  • SELECT name, type_desc FROM sys.filegroups;
  • If missing, create one via SSMS under Database Properties > Filegroups, or run:
  • ALTER DATABASE YourDatabaseName ADD FILEGROUP MemOptFG CONTAINS MEMORY_OPTIMIZED_DATA;
  • ALTER DATABASE YourDatabaseName ADD FILE (NAME='MemOptData', FILENAME='C:\SQLData\MemOptData') TO FILEGROUP MemOptFG;

Step 4: Confirm Permissions on the Service Account and User

  • Ensure the login attempting the change has ALTER or CONTROL permission on the database.
  • Run: USE YourDatabaseName; EXEC sp_helprotect NULL, NULL, NULL, 'O';
  • Grant necessary rights if missing:
  • ALTER ROLE db_owner ADD MEMBER [YourLoginName];
  • Also verify the SQL Server service account has read/write access to the data directory in Services.msc (Windows Server 2025) under “Log On” properties.

Step 5: Restart SQL Server Service and Reapply the Feature

  • Restart the SQL Server (MSSQLSERVER) service via Services.msc or PowerShell:
  • Restart-Service -Name 'MSSQLSERVER' -Force
  • Reattempt the original command that triggered Error 658 (e.g., enabling Change Tracking or memory-optimized support).

Alternative or Verification Steps

  • After applying fixes, re-run the original ALTER DATABASE or EXEC sys.sp_... command that triggered Error 658 — it should complete without error messages.
  • If the issue persists, run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to rule out catalog corruption, and review the SQL Server Error Log (via SSMS > Management > SQL Server Logs) for extended diagnostic details tied to Error 658.

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

Why This Error Happens

Error 661 occurs when an administrator attempts to enable a database-level feature (such as Change Data Capture) while another mutually exclusive feature (such as Change Tracking, or in SQL Server 2025’s expanded ledger/temporal engine, Ledger enforcement) is already active on the same database. SQL Server’s metadata engine enforces strict exclusivity between these features because their internal tracking mechanisms (commit sequence numbers, version stores, and system tables) conflict at the storage engine level. This is not a bug but a designed safeguard to prevent data corruption from two competing change-tracking subsystems writing to the same internal structures simultaneously.

Step-by-Step Resolution Guide

Step 1: Identify Which Feature Is Currently Enabled

  • Open SQL Server Management Studio (SSMS) 21 or Azure Data Studio connected to your SQL Server 2025 instance.
  • Run the following query to check the conflicting flags:
SELECT name, is_cdc_enabled, is_track_changes_on, is_ledger_enabled 
FROM sys.databases 
WHERE name = 'YourDatabaseName';
  • Note whether is_cdc_enabled = 1, is_track_changes_on = 1, or is_ledger_enabled = 1, as this tells you which feature is blocking your request.

Step 2: Disable the Conflicting Feature

  • If Change Tracking is enabled and you are trying to enable CDC, run:
ALTER DATABASE YourDatabaseName
SET CHANGE_TRACKING = OFF;
  • If CDC is enabled and you are trying to enable Change Tracking, run:
EXEC sys.sp_cdc_disable_db;
  • If Ledger enforcement is the blocking feature (new in SQL Server 2025), you must drop and recreate the database-scoped ledger configuration via ALTER DATABASE ... SET LEDGER = OFF (only possible if no ledger tables exist).

Step 3: Re-Enable the Desired Feature

  • Once the conflicting feature is fully disabled, re-run your original command, for example:
EXEC sys.sp_cdc_enable_db;
  • Confirm no error is returned and the command completes with “Command(s) completed successfully.”

Step 4: Restart Related SQL Server Services (If Needed)

  • On Windows Server 2025 / Windows 11, open Services.msc.
  • Restart SQL Server (MSSQLSERVER) and SQL Server Agent to clear any cached metadata locks related to the previous feature state.
  • This step is only required if the ALTER/DISABLE commands hang or timeout.

Alternative or Verification Steps

  • Re-run the sys.databases query from Step 1 to confirm only one of is_cdc_enabled, is_track_changes_on, or is_ledger_enabled is set to 1.
  • If the error persists after disabling the conflicting feature, check for orphaned system tables (e.g., cdc.* schema objects) using SELECT * FROM sys.tables WHERE schema_id = SCHEMA_ID('cdc') and manually drop them before retrying.

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

Troubleshooting Guide: SQL Server Error 663 – Redo Catchup Wait Timeout

Why This Error Happens

Error 663 occurs when a database mirroring or Always On Availability Group secondary replica cannot apply (redo) transaction log records fast enough to catch up to the target LSN (Log Sequence Number) within the expected time window. This is typically caused by insufficient I/O throughput on the storage subsystem hosting the data or log files, CPU contention limiting the REDO thread, or an unusually large volume of transactions (such as bulk loads or index rebuilds) being generated on the primary replica faster than the secondary can process them. In some cases, this also surfaces when the secondary replica’s hardware is significantly underpowered compared to the primary, or when corrupted/fragmented log files slow down the redo operation.

Step-by-Step Resolution Guide

Step 1: Verify Storage and I/O Performance on the Secondary Replica

  • Open Performance Monitor (perfmon.exe) on Windows Server 2025 and check the Avg. Disk sec/Read and Avg. Disk sec/Write counters for the volume hosting .mdf and .ldf files.
  • Values consistently above 20ms indicate a storage bottleneck; consider moving files to faster SSD/NVMe storage.
  • Run sys.dm_io_virtual_file_stats in SQL Server Management Studio (SSMS) to identify I/O stalls on specific database files.

Step 2: Check the Redo Queue and REDO Thread Status

  • Execute the following query on the secondary replica to inspect redo queue size:
  • SELECT database_id, redo_queue_size, redo_rate FROM sys.dm_hadr_database_replica_states;
  • If redo_queue_size is continuously growing rather than shrinking, the REDO thread is falling behind; correlate this with CPU usage via Task Manager or sys.dm_os_schedulers.
  • Consider increasing max worker threads in SQL Server Configuration Manager if thread starvation is suspected.

Step 3: Increase the Redo Catchup Timeout Threshold (Temporary Mitigation)

  • Use Trace Flag 9567 or adjust the HADR_TIMEOUT setting via T-SQL if the workload is expected to remain heavy temporarily:
  • ALTER AVAILABILITY GROUP [YourAGName] MODIFY REPLICA ON N'SecondaryNode' WITH (SESSION_TIMEOUT = 60);
  • This buys additional time for redo to catch up without triggering failover or error escalation, but does not fix the underlying I/O or CPU bottleneck.

Step 4: Reduce Transaction Volume or Offload Bulk Operations

  • Identify heavy transactions on the primary replica using sys.dm_exec_query_stats ordered by total_logical_writes.
  • Schedule bulk inserts, index maintenance, or large batch jobs during off-peak hours to reduce log generation pressure on the secondary.
  • Enable Delayed Durability (ALTER DATABASE [YourDB] SET DELAYED_DURABILITY = ALLOWED;) on the primary if transactional latency is contributing to log buildup.

Step 5: Update SQL Server 2025 and Windows Server 2025 Patches

  • Confirm you are on the latest Cumulative Update (CU) for SQL Server 2025 via SELECT @@VERSION; and compare against Microsoft’s release notes.
  • Apply any pending Windows Server 2025 updates through Windows Update or sconfig, as storage driver and network stack fixes often resolve redo performance regressions.

Alternative or Verification Steps

  • After applying fixes, re-run SELECT redo_queue_size, redo_rate FROM sys.dm_hadr_database_replica_states; and confirm the redo queue steadily decreases to zero without further Error 663 entries in the SQL Server error log.
  • If the issue persists despite storage and CPU upgrades, consider temporarily removing the affected database from the Availability Group, allowing it to fully synchronize via a fresh full backup/restore, then re-joining it to eliminate any underlying log corruption.

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

Troubleshooting Guide: SQL Server Error 652 – Index Resides on Read-Only Filegroup

Why This Error Happens

Error 652 occurs when SQL Server attempts to perform a write operation (such as an INSERT, UPDATE, DELETE, or index rebuild) against an index or table that physically resides on a filegroup marked as READ_ONLY. This typically happens after a database has been set to read-only for archival purposes, restored from a read-only snapshot, or when a specific secondary filegroup was manually flagged as read-only while the rest of the database remains writable. The underlying data files are not corrupted; the engine is simply enforcing the write-protection flag stored in the database metadata.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Filegroup and Database State

  • Run the following query to check the read-only status of filegroups: SELECT name, is_read_only FROM sys.filegroups;
  • Confirm whether the entire database is read-only using: SELECT name, is_read_only FROM sys.databases WHERE name = 'YourDatabaseName';
  • Cross-reference the RowsetId and index name from the error message using sys.indexes and sys.partitions to locate the exact object.

Step 2: Set the Filegroup or Database to Read-Write

  • If the entire database is read-only, switch it to multi-user read-write mode using SQL Server Management Studio (SSMS) or a query window:
  • ALTER DATABASE YourDatabaseName SET READ_WRITE WITH ROLLBACK IMMEDIATE;
  • If only a specific secondary filegroup is read-only, use the following syntax to toggle it:
  • ALTER DATABASE YourDatabaseName MODIFY FILEGROUP [YourFileGroupName] READWRITE;
  • Ensure no active user sessions are blocking the ROLLBACK IMMEDIATE command by checking sys.dm_exec_sessions beforehand.

Step 3: Verify File System and NTFS Permissions

  • On Windows Server 2025 or Windows 11, navigate to the physical location of the .ndf or .mdf files (commonly found in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\).
  • Right-click the specific file, select Properties > Security, and confirm the SQL Server service account (e.g., NT Service\MSSQLSERVER) has “Modify” and “Write” permissions.
  • Check if the physical file itself has a Windows-level “Read-only” attribute checked in the file’s general properties tab, and uncheck it if present.

Step 4: Rebuild the Index (If Required)

  • Once the filegroup is confirmed as READ_WRITE, attempt the original transaction or maintenance job again.
  • If the index remains inaccessible, execute a manual rebuild to refresh the internal metadata: ALTER INDEX [YourIndexName] ON [YourTableName] REBUILD;

Alternative or Verification Steps

  • Verification: Re-run SELECT name, is_read_only FROM sys.filegroups; to confirm the value has changed to 0 (False) for the specific filegroup, then attempt the write operation again to ensure Error 652 no longer appears.
  • Alternative: If the filegroup must remain read-only for compliance/archival reasons, redirect write operations to a new table located on a PRIMARY or writable secondary filegroup instead of modifying the read-only status.

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

Troubleshooting Guide: SQL Server Error 657 – Could Not Disable Feature Support

Why This Error Happens

Error 657 occurs when SQL Server 2025 attempts to disable a specific feature (such as change tracking, filestream, or a database-level compatibility feature) but detects that dependent objects, active sessions, or metadata still reference that feature within the database. This typically happens because the feature is still bound to tables, indexes, or system catalog views, or because another session holds an active lock preventing the metadata change. In some cases, the root cause is a corrupted or inconsistent system catalog entry left over from an interrupted upgrade or a previous failed attempt to toggle the feature.

Step-by-Step Resolution Guide

Step 1: Identify the Dependent Objects Blocking the Change

  • Run SELECT * FROM sys.change_tracking_tables; (or the equivalent catalog view for the feature named in %ls) to find objects still tied to the feature.
  • Check the full error message text where %S_MSG appears — it usually names the exact table, index, or session ID causing the conflict.
  • Cross-reference with sys.dm_tran_locks to see if an active transaction is holding schema locks on the database.

Step 2: Remove or Disable Dependencies Manually

  • For change tracking: run ALTER TABLE [schema].[table_name] DISABLE CHANGE_TRACKING; on every dependent table before disabling it at the database level.
  • For filestream or FILETABLE features: drop or alter any FILETABLE objects using DROP TABLE or ALTER TABLE ... SET (FILETABLE_DIRECTORY = NULL).
  • Close any open sessions using KILL <session_id>; only after confirming no critical transactions are in progress.

Step 3: Retry the Feature Disable Command in Isolation

  • Switch to single-user mode via SQL Server Configuration Manager (Windows Server 2025 / Windows 11) or run:
    ALTER DATABASE [YourDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • Re-execute the original ALTER DATABASE command that disables the feature (e.g., ALTER DATABASE [YourDB] SET CHANGE_TRACKING = OFF;).
  • Set the database back to multi-user mode: ALTER DATABASE [YourDB] SET MULTI_USER;

Step 4: Check and Repair System Catalog Consistency

  • Run DBCC CHECKDB('YourDB') WITH NO_INFOMSGS, ALL_ERRORMSGS; to confirm there is no catalog corruption tied to the feature metadata.
  • If corruption is found, restore from the last known good backup rather than using repair options that can cause data loss.
  • Review the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG on Windows Server 2025) for related warnings preceding Error 657.

Step 5: Apply Latest Cumulative Update

  • Confirm you are running the latest Cumulative Update (CU) for SQL Server 2025 via SELECT @@VERSION;.
  • Download and apply the newest CU from the Microsoft Update Catalog if your build is outdated, as this error has known fixes tied to metadata handling bugs in early builds.

Alternative or Verification Steps

  • Verify the fix by re-running the original ALTER DATABASE statement that triggered Error 657 — it should now complete without error, and querying the relevant sys.* catalog view should show the feature fully disabled.
  • If the issue persists, create a new test database, replicate the feature configuration, and confirm whether the same error occurs; this isolates whether the problem is database-specific or instance-wide, and may indicate you should open a Microsoft Support case with the ERRORLOG and DBCC CHECKDB output attached.

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

Troubleshooting Guide: Error 628 – “Cannot Issue SAVE TRANSACTION When There Is No Active Transaction”

Why This Error Happens

This error occurs when a SAVE TRANSACTION statement executes outside the scope of an explicit BEGIN TRANSACTION block, meaning SQL Server has no active transaction context to attach the savepoint to. It commonly happens due to incorrect transaction control flow in stored procedures, triggers, or application code—particularly when SET IMPLICIT_TRANSACTIONS is OFF or a prior COMMIT/ROLLBACK closed the transaction before the SAVE TRANSACTION call. Nested procedure calls that assume an ambient transaction from the caller (but don’t verify one exists) are the most frequent culprit in SQL Server 2025 environments.

Step-by-Step Resolution Guide

Step 1: Audit the Transaction Scope in the Failing Code

  • Locate the exact batch, stored procedure, or trigger referenced in the error using SSMS “Show Execution Plan” or the query text in sys.dm_exec_sql_text.
  • Confirm whether a BEGIN TRANSACTION statement precedes the SAVE TRANSACTION call in the same scope.
  • Check for early COMMIT TRANSACTION or ROLLBACK TRANSACTION statements that may close the transaction prematurely before the save point executes.

Step 2: Validate Transaction Count Before Saving

  • Insert a defensive check using @@TRANCOUNT before issuing SAVE TRANSACTION:
  • IF @@TRANCOUNT = 0 BEGIN TRANSACTION;
  • SAVE TRANSACTION MySavePoint;
  • Wrap this logic inside the stored procedure header so it self-initiates a transaction if the caller didn’t start one.

Step 3: Review SET Options and Session Configuration

  • Run DBCC USEROPTIONS; in the session to confirm whether IMPLICIT_TRANSACTIONS is set to ON or OFF.
  • If your application relies on implicit transactions, ensure the connection string or driver (ODBC/OLE DB) explicitly sets SET IMPLICIT_TRANSACTIONS ON; at the start of the session.
  • On Windows Server 2025, verify the SQL Server Native Client or Microsoft ODBC Driver 18 for SQL Server is updated to the latest build, as older drivers may mismanage transaction state across connection pooling.

Step 4: Correct Nested Procedure Transaction Handling

  • If the error originates in a nested stored procedure, modify the outer procedure to explicitly pass or verify transaction state rather than assuming inheritance.
  • Add SET XACT_ABORT ON; at the top of procedures involved in multi-step transactions to ensure consistent rollback behavior on errors, preventing orphaned transaction states that lead to this error on retry.

Alternative or Verification Steps

  • Re-run the corrected stored procedure or script in SSMS and confirm @@TRANCOUNT returns 1 immediately after BEGIN TRANSACTION and before SAVE TRANSACTION executes without error.
  • If the issue persists intermittently under load, enable a server-side trace or Extended Events session filtering on Error 628 to capture the exact session_id and sql_text at failure time, then cross-reference with connection pooling settings in your application layer.

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

Troubleshooting Guide: SQL Server Error 650 (READPAST Lock Hint Isolation Level Conflict)

Why This Error Happens

Error 650 occurs when the READPAST locking hint is applied to a query running under an incompatible transaction isolation level, such as SNAPSHOT, SERIALIZABLE, or READ UNCOMMITTED. SQL Server 2025 restricts READPAST usage strictly to READ COMMITTED or REPEATABLE READ isolation levels because the engine cannot logically skip locked rows while also guaranteeing the strict consistency models required by other isolation levels. This is typically caused by a session-level SET TRANSACTION ISOLATION LEVEL command, a connection string property, or an application ORM default that conflicts with the query hint defined in the T-SQL statement.

Step-by-Step Resolution Guide

Step 1: Identify the Current Session Isolation Level

  • Run the following diagnostic query to check the active isolation level for your session:
DBCC USEROPTIONS;
  • Look specifically for the isolation level row in the result set to confirm if it is set to serializable, snapshot, or read uncommitted.
  • Cross-reference this with the specific stored procedure or ad-hoc query that triggered Error 650.

Step 2: Modify the Transaction Isolation Level

  • Explicitly set the isolation level to READ COMMITTED before executing the query containing the READPAST hint.
  • Add this line at the top of your T-SQL script or stored procedure:
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
GO
  • Alternatively, if row versioning is required, switch to REPEATABLE READ if your business logic requires holding locks on read data:
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
GO

Step 3: Check Application Connection Strings and Drivers

  • Inspect the connection string in your application (e.g., ADO.NET, ODBC, or JDBC driver settings) for hardcoded isolation level parameters that might override your T-SQL session settings.
  • In Windows Server 2025 environments, check the ODBC Data Source Administrator (odbcad32.exe) if using a System DSN, and verify the “Isolation Level” dropdown under the SQL Server driver configuration tab.
  • For .NET applications, search your web.config or appsettings.json for Transaction Isolation Level=Snapshot or similar attributes and remove or update them to ReadCommitted.

Step 4: Remove Conflicting Database-Level Defaults

  • Check if the database has ALLOW_SNAPSHOT_ISOLATION or READ_COMMITTED_SNAPSHOT enabled, as these can sometimes interact unexpectedly with READPAST logic in complex queries.
  • Query the database properties using:
SELECT name, snapshot_isolation_state_desc, is_read_committed_snapshot_on 
FROM sys.databases 
WHERE name = 'YourDatabaseName';
  • If snapshot_isolation_state_desc returns ON and your query strictly requires READPAST, ensure the specific session explicitly overrides this with the SET TRANSACTION ISOLATION LEVEL READ COMMITTED command from Step 2.

Alternative or Verification Steps

  • Re-run the original query or stored procedure after applying the SET TRANSACTION ISOLATION LEVEL command; the query should now execute without throwing Error 650, and locked rows should be skipped successfully.
  • If the error persists in a Windows 11 development environment using SSMS, restart the Management Studio query window to clear any cached session settings, as SSMS sometimes retains isolation level settings from previous SET commands within the same tab session.

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

Troubleshooting Guide: SQL Server Error 651 – Locking Granularity Inhibited

Why This Error Happens

This error occurs when a query attempts to use a specific locking granularity hint (such as ROWLOCK or PAGLOCK) on a table where that granularity has been explicitly disabled at the table or index level. This is typically caused by an ALTER TABLE or ALTER INDEX statement that previously set ALLOW_ROW_LOCKS = OFF or ALLOW_PAGE_LOCKS = OFF. It can also happen on tables using memory-optimized structures or specific columnstore configurations where certain lock granularities are not supported by the storage engine.

Step-by-Step Resolution Guide

Step 1: Identify the Table and Index Lock Configuration

  • Open SQL Server Management Studio (SSMS) and connect to your Microsoft SQL Server 2025 instance.
  • Run the following query to check the current locking settings for the affected table:
SELECT name, allow_row_locks, allow_page_locks 
FROM sys.indexes 
WHERE object_id = OBJECT_ID('YourSchema.YourTableName');
  • Look for 0 values in the allow_row_locks or allow_page_locks columns, as this confirms the restriction causing the error.

Step 2: Re-enable the Locking Granularity

  • Execute an ALTER INDEX command to re-enable the specific locking type that the query hint is requesting.
  • If the error mentions “ROWLOCK,” ensure row locks are allowed:
ALTER INDEX ALL ON YourSchema.YourTableName 
SET (ALLOW_ROW_LOCKS = ON);
  • If the error mentions “PAGLOCK,” ensure page locks are allowed:
ALTER INDEX ALL ON YourSchema.YourTableName 
SET (ALLOW_PAGE_LOCKS = ON);

Step 3: Remove or Modify the Conflicting Query Hint

  • If changing the table schema is not permitted in your production environment, modify the application code or T-SQL script instead.
  • Remove the specific hint (e.g., WITH (ROWLOCK)) from the SELECT, UPDATE, or DELETE statement.
  • Replace the hint with a more generic locking strategy, such as WITH (TABLOCK), if row/page locking remains restricted by design.

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

  • Navigate to the Services application in Windows Server 2025 or Windows 11 (services.msc).
  • Locate SQL Server (MSSQLSERVER) or your specific named instance.
  • Right-click and select Restart to clear any cached execution plans that might still be referencing the old locking restrictions.

Alternative or Verification Steps

  • Verify the Fix: Re-run the original query that triggered Error 651. If the query executes successfully without the “locking at the specified granularity is inhibited” message, the configuration change was successful.
  • Alternative Solution: If you cannot alter the index settings due to performance policies (e.g., high-concurrency OLTP tables where row locks are intentionally disabled to prevent lock escalation), instruct developers to remove the explicit locking hint entirely and allow the SQL Server Query Optimizer to select the default locking granularity automatically.

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

Troubleshooting Guide: SQL Server Error 617 – Descriptor for Object ID Not Found in Hash Table

Why This Error Happens

Error 617 occurs when SQL Server’s internal hash table loses track of a work table descriptor, typically due to tempdb corruption, memory pressure causing premature deallocation of internal structures, or a bug triggered by complex queries involving cursors, spools, or worktables. This is often a transient issue caused by insufficient tempdb space, aggressive memory reclamation, or a race condition during parallel query execution. In rarer cases, it points to underlying corruption in tempdb data files or outdated SQL Server build binaries with unpatched query-processing defects.

Step-by-Step Resolution Guide

Step 1: Rerun the Query and Isolate the Trigger

  • Re-execute the exact query that failed; Error 617 is frequently transient and may not recur.
  • Check if the query involves cursors, TVFs, recursive CTEs, or hash/sort spills into tempdb.
  • Review SQL Server error logs at C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\Log\ERRORLOG for accompanying stack dumps or tempdb warnings.

Step 2: Check and Expand Tempdb Configuration

  • Open SSMS and navigate to Databases > System Databases > tempdb > Properties > Files.
  • Ensure tempdb has multiple data files (ideally matching CPU core count, up to 8) with autogrowth set to a fixed MB value (e.g., 256MB) rather than a percentage.
  • Verify sufficient free disk space on the drive hosting tempdb (Server Objects > tempdb file paths); low disk space during autogrowth is a common trigger.
  • Run DBCC SQLPERF(LOGSPACE) and check tempdb-specific disk latency via Performance Monitor counters (Avg. Disk sec/Write).

Step 3: Run Consistency Checks on Tempdb and User Databases

  • Execute DBCC CHECKDB('tempdb') WITH NO_INFOMSGS, ALL_ERRORMSGS; to rule out corruption (note: tempdb repair requires a service restart since it’s recreated).
  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; on the source database involved in the query.
  • If corruption is found, review backup strategy before attempting REPAIR_ALLOW_DATA_LOSS.

Step 4: Restart SQL Server Service to Reset Tempdb

  • Open Services.msc on Windows Server 2025/Windows 11, locate SQL Server (MSSQLSERVER), and restart it — this recreates tempdb from scratch, clearing any stale hash table references.
  • Alternatively, use PowerShell: Restart-Service -Name "MSSQLSERVER" -Force.
  • Confirm tempdb file sizes reset to configured defaults after restart via sys.master_files.

Step 5: Apply the Latest Cumulative Update

  • Check current build via SELECT @@VERSION; and compare against the latest SQL Server 2025 Cumulative Update on the Microsoft Download Center.
  • Download and install the CU using the standalone installer (SQLServer2025-KB########-x64.exe), following the guided setup wizard.
  • Reboot Windows Server 2025 if prompted post-installation to finalize binary replacement.

Alternative or Verification Steps

  • Re-run the original failing query along with SET STATISTICS IO ON to confirm no worktable-related errors resurface and execution completes successfully.
  • If the error persists after tempdb restart and CU installation, capture a SQL Server memory dump (via DBCC STACKDUMP) and open a support case with Microsoft CSS, referencing Error 617 and the associated worktable object ID from the error log.

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

Troubleshooting Guide: SQL Server Error 622 — Filegroup Has No Files Assigned

Why This Error Happens

Error 622 occurs when SQL Server 2025 attempts to write data to a filegroup that has been created (or referenced in metadata) but has no physical data files (.ndf/.mdf) associated with it. This typically happens after an incomplete database restore, a manually scripted filegroup creation where the ADD FILE step was skipped or failed, or corruption in the system catalog views (sys.filegroups / sys.database_files) that causes a mismatch between logical and physical file mappings. It can also surface during automated deployment scripts (DACPAC/Bacpac) on Windows Server 2025 where file paths were invalid or inaccessible due to permission restrictions on the new Windows Server storage volume.

Step-by-Step Resolution Guide

Step 1: Identify the Empty Filegroup

  • Run the following query to list all filegroups and check for zero file counts:
  SELECT fg.name AS FilegroupName, COUNT(f.file_id) AS FileCount
  FROM sys.filegroups fg
  LEFT JOIN sys.database_files f ON fg.data_space_id = f.data_space_id
  GROUP BY fg.name
  HAVING COUNT(f.file_id) = 0;
  • Note the exact filegroup name returned (case-sensitive, matches the %.*ls placeholder in the error).

Step 2: Add a Physical Data File to the Filegroup

  • Open SQL Server Management Studio (SSMS) or a query window with sysadmin privileges.
  • Execute an ALTER DATABASE statement to bind a file to the empty filegroup:
  ALTER DATABASE [YourDatabaseName]
  ADD FILE (
      NAME = N'YourFilegroup_Data',
      FILENAME = N'D:\SQLData\YourFilegroup_Data.ndf',
      SIZE = 100MB,
      FILEGROWTH = 50MB
  ) TO FILEGROUP [YourFilegroup];
  • Ensure the target directory (e.g., D:\SQLData\) exists and that the SQL Server service account has Full Control permissions on that folder via Windows Server 2025 File Explorer security settings.

Step 3: Validate Windows Service Account Permissions

  • Open Services.msc on Windows Server 2025 / Windows 11 and confirm the SQL Server service is running under the correct domain or virtual account.
  • Navigate to the data directory in File Explorer > Properties > Security and verify NT SERVICE\MSSQLSERVER (or your named instance) has read/write access.
  • Restart the SQL Server service after permission changes to force a re-read of file handles.

Step 4: Rebuild Indexes/Tables Tied to the Filegroup (If Applicable)

  • If tables were already mapped to the broken filegroup before the file was added, rebuild them to force reallocation:
  ALTER TABLE YourTable REBUILD PARTITION = ALL WITH (DATA_COMPRESSION = NONE);
  • This ensures existing data structures recognize the newly attached file.

Alternative or Verification Steps

  • Re-run the diagnostic query from Step 1 to confirm the FileCount for the filegroup is now greater than zero.
  • If the issue persists after adding a file, run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS to rule out deeper catalog corruption requiring a restore from a known-good backup.

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

Troubleshooting Guide: SQL Server Error 627

Why This Error Happens

Error 627 occurs because SAVE TRANSACTION (which creates a savepoint for partial rollbacks) is fundamentally incompatible with distributed transactions managed by the Microsoft Distributed Transaction Coordinator (MSDTC). Once a transaction is escalated to a distributed transaction—either explicitly via BEGIN DISTRIBUTED TRANSACTION or implicitly through linked server calls—SQL Server locks the transaction control flow across all participating resource managers, making partial savepoints impossible to coordinate. This typically surfaces when application code or ORM frameworks attempt to nest savepoints inside logic that spans multiple servers or databases without checking the transaction context first.

Step-by-Step Resolution Guide

Step 1: Identify the Transaction Escalation Trigger

  • Check application code (C#, T-SQL, or ORM-generated queries) for calls to linked servers, remote procedure calls, or BEGIN DISTRIBUTED TRANSACTION.
  • Run SELECT DTC_STATE FROM sys.dm_tran_distributed_transactions to confirm if a distributed transaction is currently active.
  • Review Event Viewer under Windows Logs > Application for MSDTC-related entries alongside Error 627.

Step 2: Refactor Transaction Logic to Remove Savepoints

  • Remove any SAVE TRANSACTION statements that execute after a distributed transaction has been initiated.
  • Restructure logic to use a single, non-nested transaction block: BEGIN TRAN → perform work → COMMIT/ROLLBACK without intermediate savepoints.
  • If partial rollback logic is required, isolate the distributed operation into its own separate transaction scope, completed before any local transaction with savepoints begins.

Step 3: Verify MSDTC Configuration on Windows Server 2025 / Windows 11

  • Open dcomcnfg.exe → navigate to Component Services > Computers > My Computer > Distributed Transaction Coordinator > Local DTC.
  • Right-click Local DTC > Properties > Security tab, and ensure “Network DTC Access,” “Allow Inbound,” and “Allow Outbound” are all enabled.
  • Restart the MSDTC service via services.msc or run: net stop msdtc && net start msdtc in an elevated Command Prompt.

Step 4: Adjust Connection String or Linked Server Settings

  • In SQL Server Management Studio, right-click the linked server → Properties > Server Options, and confirm “RPC” and “RPC Out” are set to True only if remote procedure calls are intentional.
  • If distributed transactions are not required, disable automatic promotion by setting ENABLE_PROMOTION to OFF on the linked server definition using sp_serveroption.

Alternative or Verification Steps

  • After refactoring, re-run the transaction and confirm Error 627 no longer appears in sys.messages logs or SSMS output.
  • If the error persists, use SQL Server Profiler or Extended Events to trace Transaction Manager events and confirm the exact point of escalation, then isolate that specific query/procedure for further refactoring.

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

Troubleshooting Guide: SQL Server Error 614 – “Could Not Locate Bookmark Due to Data Movement”

Why This Error Happens

Error 614 occurs when SQL Server’s query optimizer uses a bookmark lookup (RID or Key lookup) to retrieve a row, but the underlying row has moved or been deleted between the time the index pointer was read and when the Storage Engine attempted to fetch the actual data page. This is typically caused by non-serializable transaction isolation levels (like READ COMMITTED or READ UNCOMMITTED) combined with heavy concurrent DML operations, or it can result from index/page corruption that has desynchronized the index structure from the heap. In rare cases, this error surfaces due to underlying disk-level corruption on Windows Server 2025 storage volumes affecting the .mdf or .ndf files.

Step-by-Step Resolution Guide

Step 1: Run DBCC CHECKDB to Rule Out Corruption

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Execute: DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for allocation or consistency errors that may indicate physical corruption on the heap or index pages.
  • If corruption is found, plan for DBCC CHECKDB('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) only as a last resort after taking a full backup.

Step 2: Rebuild the Affected Indexes

  • Identify the table referenced in the error message from the SQL Server Error Log (Applications and Services Logs > SQL Server in Event Viewer, filtered by Event ID 614).
  • Execute: ALTER INDEX ALL ON YourSchema.YourTableName REBUILD WITH (ONLINE = ON, MAXDOP = 4);
  • This resynchronizes the non-clustered index bookmarks with the underlying heap or clustered index structure.

Step 3: Adjust Transaction Isolation Level

  • Review application connection strings and stored procedures for use of READ UNCOMMITTED or NOLOCK hints, which increase the likelihood of bookmark lookup failures during concurrent writes.
  • Change isolation level to READ COMMITTED SNAPSHOT at the database level using: ALTER DATABASE YourDatabaseName SET READ_COMMITTED_SNAPSHOT ON;
  • Ensure this change is made during a maintenance window, as it requires exclusive database access briefly.

Step 4: Verify Storage Subsystem Health on Windows Server 2025

  • Open Server Manager > Tools > Event Viewer and check the System log for Disk or NTFS warnings (Event ID 7, 51, or 153).
  • Run chkdsk D: /f /r (replace D: with your SQL data drive) during a scheduled downtime window to repair file system-level issues.
  • Confirm the storage driver and firmware are updated via Windows Update or the vendor’s storage management utility.

Step 5: Apply Latest SQL Server 2025 Cumulative Update

  • Navigate to the Microsoft Update Catalog and download the latest Cumulative Update (CU) for SQL Server 2025.
  • Run the installer as Administrator and follow the prompts to patch the instance.
  • Restart the SQL Server service via SQL Server Configuration Manager after installation completes.

Alternative or Verification Steps

  • Re-run the original query or stored procedure that triggered Error 614 under a READ COMMITTED SNAPSHOT isolation level and confirm no errors appear in the SQL Server Error Log for 24–48 hours.
  • If the error persists after index rebuilds and isolation changes, restore the database from the most recent clean backup to a test environment and run DBCC CHECKDB there to isolate whether the issue is data-specific or environment-specific (e.g., faulty RAID controller on the Windows Server 2025 host).

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

Troubleshooting Guide: SQL Server Error 615 – “Could not find database ID %d”

Why This Error Happens

Error 615 occurs when SQL Server’s internal metadata (sys.databases) references a database ID that no longer maps to an active, online database. This typically happens due to a corrupted or stale entry in the system catalog, an interrupted database drop/detach operation, or a mismatch between the resource database and the master database following an improper failover or restore. It can also surface when a process—such as a backup job, replication task, or third-party monitoring tool—holds a cached reference to a database ID that has since been dropped or recreated.

Step-by-Step Resolution Guide

Step 1: Identify the Orphaned Database ID

  • Run the following query to cross-reference the reported ID against current entries:
  SELECT name, database_id, state_desc FROM sys.databases;
  • Check SQL Server Error Log (via SSMS or C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the exact timestamp and preceding events.
  • Note whether the ID corresponds to a database that was recently dropped, detached, or restored.

Step 2: Clear Cached Plans and Connections

  • Stale execution plans or connection pools sometimes hold references to old database IDs.
  • Run:
  DBCC FREEPROCCACHE;
  DBCC DROPCLEANBUFFERS;
  • Restart the SQL Server service via Services.msc or PowerShell:
  Restart-Service -Name 'MSSQLSERVER' -Force

Step 3: Validate System Catalog Integrity

  • Run consistency checks against the master database to rule out corruption:
  DBCC CHECKDB('master') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • If corruption is found, restore master from a known good backup using single-user mode:
  NET START MSSQLSERVER /m
  • Reboot into multi-user mode once restoration completes.

Step 4: Re-sync Application or Job References

  • Update any SQL Agent jobs, linked server configurations, or application connection strings that may reference the old (now invalid) database ID or name.
  • Check msdb.dbo.sysjobsteps for hardcoded database_id references in scripts.
  • Re-point these references to the current, valid database name rather than a cached ID.

Alternative or Verification Steps

  • Verify the fix by re-running the original query or application call that triggered Error 615; confirm no entries in ERRORLOG reference the missing ID afterward.
  • If the issue persists, restore the entire instance from the last full backup taken before the corruption was introduced, then reapply transaction logs to minimize data loss.

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

Troubleshooting Guide: SQL Server Error 610 – Invalid Header Value

Why This Error Happens

Error 610 occurs when SQL Server encounters a page header that doesn’t match expected values, typically indicating physical-level data corruption on disk. This can result from faulty storage hardware, improper shutdowns, disk controller issues, or file system errors that corrupted the database page before SQL Server could read it correctly. It may also surface after a failed I/O operation where the write to disk was incomplete or interrupted mid-transaction.

Step-by-Step Resolution Guide

Step 1: Run DBCC CHECKDB to Assess the Damage

  • Open SQL Server Management Studio (SSMS) or sqlcmd and connect to the affected instance.
  • Execute: DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output carefully to identify which pages, tables, or indexes are affected by the corruption.
  • Note the allocation and consistency errors reported, as this determines your repair strategy.

Step 2: Check Underlying Storage and Windows Event Logs

  • Open Event Viewer on Windows Server 2025 / Windows 11 and navigate to Windows Logs > System.
  • Look for Disk, ntfs, or storahci errors around the same timestamp as the SQL error.
  • Run chkdsk C:\ /f /r (adjust drive letter to your data file location) after scheduling a restart if needed.
  • Verify SAN/RAID controller health and firmware if running on physical or virtualized storage.

Step 3: Restore from a Clean Backup (Preferred Method)

  • Navigate to your backup storage location, typically E:\SQLBackups\ or your configured backup share.
  • Restore the most recent full backup along with subsequent differential/log backups using:
    RESTORE DATABASE YourDatabaseName FROM DISK = 'E:\SQLBackups\YourDatabaseName.bak' WITH REPLACE;
  • Apply transaction log backups in sequence to bring the database to the point just before corruption occurred.

Step 4: Use DBCC CHECKDB REPAIR Options (If No Clean Backup Exists)

  • Set the database to single-user mode: ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
  • Run the repair command: DBCC CHECKDB('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS);
  • Understand this may delete corrupted rows/pages to restore consistency, so use only as a last resort.
  • Set the database back to multi-user mode: ALTER DATABASE YourDatabaseName SET MULTI_USER;

Step 5: Isolate the Corrupted Page (Advanced Scenario)

  • If only a single page is affected, use RESTORE DATABASE ... PAGE = 'FileID:PageID' to restore just that page from a backup.
  • Follow up with a transaction log backup restore to bring the page current.
  • This avoids a full database restore when corruption is isolated to a small number of pages.

Alternative or Verification Steps

  • After remediation, re-run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; and confirm zero allocation or consistency errors are returned.
  • If corruption recurs frequently, run hardware diagnostics (manufacturer disk utility) and consider migrating the database files to a different physical volume to rule out failing storage.

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

Troubleshooting Guide: SQL Server Error 611 – “Cannot Insert or Update a Row Because Total Variable Column Size”

Why This Error Happens

This error occurs when the combined size of all variable-length columns (varchar, nvarchar, varbinary, sql_variant) in a single row exceeds the internal 8,060-byte row-size limit enforced by the storage engine at write time, even though SQL Server’s row-overflow feature allows the schema to be defined beyond this limit. It typically surfaces after bulk inserts, migrations, or application logic that populates most or all nullable/variable columns simultaneously, pushing actual stored data past the physical page threshold. It can also be triggered by corrupted page structures or incorrect collation settings that inflate character data size (e.g., double-byte collations).

Step-by-Step Resolution Guide

Step 1: Identify the Offending Table and Row Size

  • Run sp_help 'YourTableName' or query sys.columns joined with sys.types to calculate total defined byte length of all variable-length columns.
  • Use DBCC PAGE (with trace flag 3604 enabled) on the failing page/row to inspect actual stored byte count if you have the Page ID from the error context.
  • Execute EXEC sp_spaceused 'YourTableName' to check average row size and data distribution.

Step 2: Redesign the Schema to Reduce Row Width

  • Split wide tables vertically: move rarely-accessed or large variable columns (e.g., large nvarchar(max) fields) into a separate related table with a 1:1 foreign key relationship.
  • Convert unnecessarily large fixed-length declarations (e.g., nvarchar(4000) used for short strings) to right-sized lengths.
  • Consider changing varchar(max)/nvarchar(max) columns to store data off-row explicitly using:
  EXEC sp_tableoption 'YourTableName', 'large value types out of row', '1';

Step 3: Adjust the Insert/Update Batch Logic

  • Modify ETL or application insert statements to populate only necessary columns per transaction instead of all variable columns at once.
  • If using bulk insert utilities (bcp, BULK INSERT, SSIS), batch data in smaller chunks and validate source column lengths against destination schema before load.
  • Re-run the failing transaction in a test environment after schema/application changes to confirm the row now fits within the 8,060-byte engine limit.

Step 4: Check for Page Corruption or Collation Issues

  • Run DBCC CHECKTABLE ('YourTableName') WITH DATA_PURITY to rule out corruption inflating stored byte size.
  • Verify collation settings via SELECT DATABASEPROPERTYEX('YourDB', 'Collation'); a double-byte collation can double character storage requirements unexpectedly.

Alternative or Verification Steps

  • Verify the fix by re-inserting the previously failing row/batch and confirming Error 611 no longer appears in SQL Server Error Log or Windows Event Viewer (Application log, Source: MSSQLSERVER).
  • As an alternative, if schema redesign isn’t immediately feasible, enable row-overflow storage (default in SQL Server 2025) and ensure large object columns are marked SPARSE where appropriate to reduce logical row footprint without changing table structure.

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

Troubleshooting Guide: SQL Server Error 613 — “Could Not Find an Entry for Worktable Rowset”

Why This Error Happens

Error 613 occurs when SQL Server’s internal worktable rowset metadata becomes inconsistent with the actual partition entries stored in tempdb, typically caused by tempdb corruption or an interrupted operation involving hash joins, sorts, or spool operations. This can also arise from insufficient tempdb space causing incomplete allocation of worktable structures, or from underlying disk-level corruption affecting tempdb data files. In rarer cases, outdated SQL Server 2025 cumulative updates contain known bugs in the query processor’s handling of complex execution plans that use worktables.

Step-by-Step Resolution Guide

Step 1: Verify Tempdb Health and Configuration

  • Open SQL Server Management Studio (SSMS) and run DBCC CHECKDB (tempdb) WITH NO_INFOMSGS, ALL_ERRORMSGS; to check for corruption.
  • Confirm tempdb data and log files are not full by checking sys.database_files for size and growth settings.
  • Verify tempdb files are located on a healthy, non-full disk volume (recommended: dedicated SSD storage separate from OS drive).

Step 2: Restart the SQL Server Service to Rebuild Tempdb

  • Open Services.msc on Windows Server 2025 / Windows 11.
  • Locate SQL Server (MSSQLSERVER) or your named instance, right-click, and select Restart.
  • This forces tempdb to be recreated from scratch, clearing any corrupted worktable metadata.
  • Alternatively, run via PowerShell: Restart-Service -Name 'MSSQLSERVER' -Force

Step 3: Apply the Latest Cumulative Update

  • Navigate to Microsoft Update Catalog and download the latest Cumulative Update (CU) for SQL Server 2025.
  • Check current build version with: SELECT @@VERSION;
  • Install the CU package and reboot the server if prompted, as this resolves known query processor bugs related to worktable handling.

Step 4: Identify and Isolate the Problematic Query

  • Use SQL Server Profiler or Extended Events to capture the exact query triggering Error 613.
  • Check the query execution plan for complex hash joins, sorts, or spool operators using SET STATISTICS PROFILE ON;
  • Rewrite the query to reduce reliance on large intermediate worktables, such as by adding appropriate indexes or breaking the query into smaller batches.

Step 5: Run a Full Consistency Check on the User Database

  • Execute DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; against the database referenced in the error message (using the database ID %d from the error).
  • Review output for corruption in user tables that may be indirectly causing worktable allocation failures.
  • If corruption is found, restore from the most recent clean backup rather than using REPAIR_ALLOW_DATA_LOSS.

Alternative or Verification Steps

  • Re-run the original failing query or workload after completing the steps above; confirm Error 613 no longer appears in the SQL Server Error Log (EXEC sp_readerrorlog;).
  • If the issue persists, failover to a secondary replica (if using Always On Availability Groups) and rebuild the primary node’s tempdb configuration from scratch as a workaround.

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

Troubleshooting Guide: Error 606 – Metadata Inconsistency (Filegroup ID Not Found)

Why This Error Happens

Error 606 occurs when SQL Server’s internal system catalog (sys.sysallocunits, sys.filegroups, or related metadata tables) references a filegroup ID that no longer exists for a given table. This typically happens due to database corruption caused by improper shutdowns, storage-level failures, or interrupted filegroup operations (such as a failed ALTER DATABASE ... REMOVE FILEGROUP command). It can also occur after a botched database restore, replication mismatch, or manual manipulation of system tables.

Step-by-Step Resolution Guide

Step 1: Run DBCC CHECKDB to Assess Damage

  • Open SQL Server Management Studio (SSMS) or sqlcmd on your Windows Server 2025 / Windows 11 host.
  • Execute: DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
  • Review the output for specific object IDs and filegroup IDs flagged as inconsistent.
  • Note whether the corruption is isolated to one table or spans multiple system catalog views.

Step 2: Validate Filegroup and Catalog Consistency

  • Run DBCC CHECKCATALOG ('YourDatabaseName'); to specifically check for orphaned metadata references.
  • Cross-reference the reported filegroup ID against SELECT * FROM sys.filegroups; to confirm it is genuinely missing.
  • Check sys.database_files to see if a data file tied to that filegroup was dropped or is offline.

Step 3: Restore From a Known-Good Backup

  • If corruption is confirmed and no repair options resolve it cleanly, restore the database from the most recent verified backup taken before the inconsistency appeared.
  • Use: RESTORE DATABASE YourDatabaseName FROM DISK = 'D:\Backups\YourDatabaseName.bak' WITH REPLACE, RECOVERY;
  • Ensure the backup file path exists and the SQL Server service account has read permissions on that directory.

Step 4: Apply Emergency Repair as a Last Resort

  • If no backup is available, set the database to emergency mode: ALTER DATABASE YourDatabaseName SET EMERGENCY;
  • Run DBCC CHECKDB ('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS; in single-user mode.
  • Understand this may drop the affected rows or objects tied to the invalid filegroup reference — treat this as a data-loss operation.

Step 5: Rebuild Filegroup Structure if Needed

  • If the filegroup was legitimately removed but references remain, manually script out the affected table and recreate it under a valid, existing filegroup.
  • Use sp_help 'TableName' to confirm current filegroup mapping before recreating objects.

Alternative or Verification Steps

  • After remediation, re-run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; and confirm zero allocation or consistency errors are returned.
  • If Error 606 persists after backup restoration, engage Microsoft Support with the DBCC output logs, as it may indicate deeper storage subsystem corruption (check Windows Event Viewer for related Disk or NTFS errors).

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

Troubleshooting Guide: SQL Server Error 608 – “No Catalog Entry Found for Partition ID”

Why This Error Happens

Error 608 occurs when SQL Server’s internal metadata becomes desynchronized, typically because the sys.partitions system catalog no longer references a partition ID that is still being pointed to by an index or allocation unit. This inconsistency is most commonly triggered by abrupt shutdowns during DDL operations (like index rebuilds or partition switching), disk-level corruption on the underlying storage, or a failed/interrupted restore operation. In rare cases, it can also result from a bug in third-party backup/replication tools that manipulate database files while SQL Server has them offline.

Step-by-Step Resolution Guide

Step 1: Isolate the Affected Database and Take a Backup

  • Immediately take a full backup of the current database state (even if corrupted) using BACKUP DATABASE [YourDB] TO DISK = 'C:\Backups\YourDB_PreFix.bak' — this preserves forensic evidence before you attempt repairs.
  • Check the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the exact database ID and timestamp correlating with the Event ID 608 entry.
  • Restrict user access temporarily by setting the database to SINGLE_USER mode via SSMS or ALTER DATABASE [YourDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE.

Step 2: Run DBCC CHECKDB for Diagnostics

  • Open a new query window in SQL Server Management Studio (SSMS) connected to the instance.
  • Execute DBCC CHECKDB ('YourDB') WITH NO_INFOMSGS, ALL_ERRORMSGS to generate a full consistency report.
  • Review the output specifically for messages referencing “Object ID” and “Partition ID” mismatches, as these confirm the specific table causing the catalog break.

Step 3: Apply the Appropriate Repair Level

  • If the report suggests REPAIR_REBUILD, run DBCC CHECKDB ('YourDB', REPAIR_REBUILD) first, as this level does not result in data loss and simply rebuilds the missing metadata links.
  • If the corruption is severe and REPAIR_REBUILD fails to resolve the partition ID conflict, you may need to escalate to DBCC CHECKDB ('YourDB', REPAIR_ALLOW_DATA_LOSS), understanding that this may deallocate the specific corrupted rows or pages to restore metadata consistency.
  • Ensure the database remains in SINGLE_USER mode during this specific repair execution to prevent lock contention errors.

Step 4: Restore from a Clean Backup (If Repair Fails)

  • If DBCC repair commands cannot resolve the underlying hardware-level corruption, restore the most recent known-good .bak file taken before the metadata inconsistency began.
  • Use the Windows Server 2025 Event Viewer (eventvwr.msc) to check the “System” logs for underlying Disk or NTFS corruption errors (Event ID 7 or 55) that might have caused the initial break.

Alternative or Verification Steps

  • Verification: Re-run DBCC CHECKDB ('YourDB') WITH NO_INFOMSGS, ALL_ERRORMSGS after the repair; a clean pass with “0 allocation errors and 0 consistency errors” confirms the partition catalog is synchronized.
  • Alternative: If the issue persists only on specific large tables, try exporting the data via BCP (Bulk Copy Program) to a flat file, drop and recreate the specific table/partition scheme, and re-import the data to bypass the corrupted partition ID entirely.

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

Why This Error Happens

Error 609 occurs when SQL Server’s storage engine detects that a BTree structure associated with a RowsetBulk operation still contains data when it expects to be empty during a wake-up/resume phase of a bulk insert or index rebuild transaction. This typically stems from corrupted database pages, an interrupted bulk-load operation (such as a crashed BCP or SSIS job), or inconsistent internal metadata caused by improper shutdowns. In some cases, outdated storage drivers or antivirus software locking I/O operations on the data files can also trigger this internal consistency check failure.

Step-by-Step Resolution Guide

Step 1: Verify Database Consistency

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORS; to scan for corruption.
  • Review the output for allocation or B-tree page errors tied to the RowsetBulk operation.

Step 2: Terminate and Roll Back the Offending Transaction

  • Identify the session ID using sp_who2 or query sys.dm_exec_requests for long-running bulk transactions.
  • Execute KILL <SPID> on the stalled bulk insert/rebuild session.
  • Confirm rollback completion by checking sys.dm_tran_active_transactions.

Step 3: Rebuild Affected Indexes

  • Navigate to the specific table flagged in the error log (found in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG).
  • Run ALTER INDEX ALL ON [SchemaName].[TableName] REBUILD; to force regeneration of the B-tree structure.
  • Ensure sufficient tempdb space is allocated on Windows Server 2025 before executing.

Step 4: Repair Data Files if Corruption Persists

  • If DBCC CHECKDB reports irrecoverable errors, run DBCC CHECKDB ('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) in single-user mode as a last resort.
  • Restore from the most recent verified backup if repair is unsuccessful.

Alternative or Verification Steps

  • Re-run the original bulk insert or index operation and monitor the SQL Server Error Log for recurrence of Error 609.
  • If the issue persists, update the storage/RAID controller drivers on Windows Server 2025 and disable any antivirus real-time scanning on the .mdf/.ldf file paths, then retry the operation.

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

Troubleshooting Guide: SQL Server Error 602

Why This Error Happens

Error 602 occurs when SQL Server’s internal system catalog (specifically sys.system_internals_allocation_units or related metadata) references a partition ID that no longer maps to a valid table or index. This typically happens due to metadata corruption caused by improper shutdowns, storage-level I/O failures, or a stored procedure/cached execution plan referencing a table object that has since been dropped and recreated. In rare cases, this can also surface after a failed or interrupted ALTER TABLE operation that left the partition metadata in an inconsistent state.

Step-by-Step Resolution Guide

Step 1: Clear the Procedure Cache and Recompile

  • Run DBCC FREEPROCCACHE to remove stale execution plans that may reference dropped table objects.
  • Follow with sp_recompile 'YourProcedureName' on the specific stored procedure reported in the error log.
  • Restart the SQL Server service via services.msc on Windows Server 2025 if the error persists after cache clearing.

Step 2: Run Database Consistency Checks

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Execute DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS to identify corruption in system tables or partition metadata.
  • Review the output for allocation errors tied to the specific partition ID mentioned in the original Error 602 message.

Step 3: Identify and Rebuild the Affected Object

  • Query sys.partitions and sys.allocation_units to cross-reference the partition ID from the error against existing objects:
  SELECT * FROM sys.partitions WHERE partition_id = <ID_from_error>;
  • If the object is missing, locate the stored procedure or view via sys.sql_modules that still references the old table name.
  • Drop and recreate the affected stored procedure with DROP PROCEDURE followed by CREATE PROCEDURE, ensuring it points to the current, valid table.

Step 4: Restore from Backup if Corruption Persists

  • If DBCC CHECKDB reports unrepairable allocation errors, take a full backup of the current (corrupted) database state for forensic purposes.
  • Restore the last known good full backup plus transaction logs using RESTORE DATABASE ... WITH RECOVERY in SSMS or via PowerShell using the SqlServer module.
  • Validate the Windows Server 2025 storage subsystem (Event Viewer > Windows Logs > System) for underlying disk I/O errors that may have caused the corruption.

Alternative or Verification Steps

  • After applying fixes, re-run the original stored procedure or query that triggered Error 602 to confirm it executes without exception.
  • Schedule a recurring DBCC CHECKDB job via SQL Server Agent to catch future partition/metadata inconsistencies before they cause application-level failures.

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

Troubleshooting Guide: SQL Server Error 603

Why This Error Happens

Error 603 occurs when SQL Server’s internal metadata cache holds a reference to an object ID or partition ID that no longer exists in the system catalog, typically because a table or index was dropped or altered while a cached query plan or stored procedure still referenced its old structure. This is frequently triggered by schema changes executed outside of proper transactional boundaries, or by corruption in the plan cache following an improper shutdown. In some cases, this also stems from underlying database corruption in the system catalog views (sys.objects, sys.partitions) caused by disk-level I/O errors.

Step-by-Step Resolution Guide

Step 1: Clear the Procedure Cache

  • Open SQL Server Management Studio (SSMS) and connect to the affected instance.
  • Run DBCC FREEPROCCACHE; to purge stale execution plans that reference dropped objects.
  • Alternatively, target a specific plan using DBCC FREEPROCCACHE(plan_handle); if you’ve isolated the offending query.

Step 2: Identify and Recompile Affected Stored Procedures

  • Query sys.dm_exec_query_stats joined with sys.dm_exec_sql_text to locate procedures referencing the object ID from the error message.
  • Manually mark procedures for recompilation using EXEC sp_recompile 'SchemaName.ProcedureName';
  • Check application code and deployment scripts for any DROP TABLE or ALTER TABLE statements executed against tables still actively referenced elsewhere.

Step 3: Run Database Consistency Checks

  • Open Command Prompt or PowerShell as Administrator on Windows Server 2025 / Windows 11.
  • Execute DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to scan for catalog or allocation corruption.
  • Review the output for orphaned partition IDs or object ID mismatches in sys.partitions and sys.allocation_units.

Step 4: Restart the SQL Server Service (If Cache Corruption Persists)

  • Open Services.msc on Windows Server 2025 / Windows 11.
  • Locate SQL Server (MSSQLSERVER) or your named instance, right-click, and select Restart.
  • This forces a full rebuild of the in-memory metadata cache, resolving stale object ID references.

Step 5: Restore from Backup (If Corruption Is Confirmed)

  • If DBCC CHECKDB reports unrecoverable catalog corruption, restore the database from the most recent clean backup using SSMS’s Restore Database wizard.
  • Apply transaction log backups afterward if point-in-time recovery is required.

Alternative or Verification Steps

  • After applying fixes, re-run the original query or stored procedure that triggered Error 603 to confirm it executes without exception.
  • If the error persists, run DBCC CHECKDB with the REPAIR_ALLOW_DATA_LOSS option only as a last resort in a maintenance window, after ensuring you have a verified backup.

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

Troubleshooting Guide: SQL Server Error 605

Why This Error Happens

Error 605 occurs when SQL Server’s storage engine detects a mismatch between the logical page ID recorded in a page header and the allocation unit that is supposed to own it, indicating physical database corruption. This is typically caused by disk I/O subsystem failures, faulty storage drivers, or improper shutdowns that leave pages in an inconsistent state. It can also surface after a failed or interrupted restore, a SAN/storage replication glitch, or memory corruption on the host that gets flushed to disk.

Step-by-Step Resolution Guide

Step 1: Confirm the Scope of Corruption

  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS to get a full corruption report.
  • Note the specific object ID, index ID, and page ID referenced in the error output.
  • Check the SQL Server error log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for related I/O or storage warnings around the same timestamp.

Step 2: Rule Out Hardware and Storage Issues

  • Open Windows Event Viewer (eventvwr.msc) and inspect the System log under Windows Logs for Disk, ntfs, or storport errors.
  • Run chkdsk C:\ /f /r (or the appropriate drive letter hosting your .mdf/.ndf files) during a maintenance window to detect and repair filesystem-level errors.
  • Verify SAN/storage controller firmware and drivers are up to date, especially if using virtualized or replicated storage (Hyper-V, Storage Spaces Direct, etc.).

Step 3: Restore from a Known-Good Backup

  • Take a tail-log backup if the database is still accessible: BACKUP LOG YourDatabaseName TO DISK = 'D:\Backups\YourDatabase_tail.trn' WITH NORECOVERY.
  • Restore the last verified full backup along with subsequent differential/log backups using RESTORE DATABASE YourDatabaseName FROM DISK = 'D:\Backups\YourDatabase_full.bak' WITH NORECOVERY, followed by log restores WITH RECOVERY on the final file.
  • This is the safest fix since Error 605 indicates physical corruption that repair commands cannot always resolve without data loss.

Step 4: Use DBCC CHECKDB Repair as a Last Resort

  • If no valid backup exists, set the database to single-user mode: ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE.
  • Run DBCC CHECKDB('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS, ALL_ERRORMSGS.
  • Revert to multi-user mode afterward: ALTER DATABASE YourDatabaseName SET MULTI_USER.
  • Understand that this option can delete corrupted pages/rows permanently to restore structural consistency.

Alternative or Verification Steps

  • After remediation, re-run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS and confirm it returns zero allocation or consistency errors.
  • If corruption recurs shortly after repair, treat it as a hardware-level symptom and engage your storage vendor or run extended memory diagnostics (mdsched.exe) to rule out faulty RAM causing repeated on-disk corruption.

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

Troubleshooting Guide: SQL Server Error 599 – Large Type Result Length Exceeded

Why This Error Happens

Error 599 occurs when a T-SQL operation—typically a string concatenation, FOR XML, STRING_AGG, or implicit conversion involving nvarchar(max), varchar(max), or xml data types—produces a result that exceeds the 2GB internal storage limit for large object (LOB) types. This is commonly triggered by unbounded aggregation queries, recursive CTEs without proper row limits, or application code that concatenates large datasets into a single string variable. It is a hard engine-level limit, not a configuration setting, so it cannot be resolved by adjusting server memory or storage settings alone.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query or Procedure

  • Check SQL Server Error Log (%ProgramFiles%\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for the exact statement or batch that triggered Error 599.
  • Enable Extended Events session to capture error_reported events filtered on Error 599 to pinpoint the query text and execution plan.
  • Look specifically for STRING_AGG, FOR XML PATH, += string concatenation in loops, or CONCAT_WS operations on large result sets.

Step 2: Refactor the Query to Limit Result Size

  • Add TOP (n) or WHERE clauses to reduce the number of rows being aggregated or concatenated.
  • Break large STRING_AGG or XML aggregation operations into paginated batches (e.g., process 10,000 rows per batch instead of the entire table).
  • If using recursive CTEs, add OPTION (MAXRECURSION n) to prevent runaway concatenation.
  • Replace client-side string building with SELECT result sets processed in the application layer instead of building a single massive string.

Step 3: Adjust Application/Driver Handling for Large Objects

  • If retrieving results via ADO.NET, ODBC, or JDBC, ensure the client is configured to stream LOB data rather than materialize it fully in memory.
  • In connection strings, verify MultipleActiveResultSets=True and appropriate command timeout values are set to handle large data retrieval in chunks.
  • For SSIS packages, adjust the Data Flow buffer size and ensure the DT_TEXT/DT_NTEXT column handling isn’t forcing full materialization.

Step 4: Test with Reduced Dataset and Monitor

  • Run the modified query against a scaled-down dataset (e.g., 1000 rows) in SQL Server Management Studio (SSMS) to confirm the logic works without hitting the limit.
  • Use SET STATISTICS IO, TIME ON to monitor resource consumption and confirm the query no longer approaches the 2GB threshold.

Alternative or Verification Steps

  • Re-run the original failing query/procedure in a test environment and confirm it completes without Error 599 appearing in SSMS or the Error Log.
  • If refactoring isn’t immediately feasible, use sys.dm_exec_query_stats to monitor query result sizes over time and set up an alert via SQL Server Agent to flag queries approaching the 2GB limit before they fail in production.

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

Troubleshooting Guide: SQL Server Error 601 – “Could Not Continue Scan with NOLOCK Due to Data Movement”

Why This Error Happens

This error occurs when a query using the NOLOCK hint (or under READ UNCOMMITTED isolation level) performs a table scan on a heap table, and concurrent data modifications physically relocate rows during the scan. Since heaps lack a clustered index to maintain a stable logical ordering, operations like UPDATE statements that increase row size can force SQL Server to move rows to new pages, causing the scan to lose its position. This is a known limitation of dirty reads against heap structures rather than a sign of database corruption.

Step-by-Step Resolution Guide

Step 1: Identify the Affected Table and Query

  • Capture the exact query from SQL Server error logs or Extended Events session output.
  • Run the following to check if the table is a heap (no clustered index):
SELECT OBJECT_NAME(object_id), index_id, type_desc 
FROM sys.indexes 
WHERE object_id = OBJECT_ID('YourTableName') AND index_id = 0;
  • Confirm the query uses WITH (NOLOCK) or runs under READ UNCOMMITTED isolation.

Step 2: Add a Clustered Index to the Heap Table

  • Navigate to SSMS, right-click the table under Databases > YourDB > Tables.
  • Create a clustered index on a stable, unique column (commonly the primary key):
CREATE CLUSTERED INDEX CIX_YourTable_ID 
ON dbo.YourTableName (YourPrimaryKeyColumn);
  • This resolves the root cause since clustered indexes maintain row order via B-tree structure rather than physical heap pages.

Step 3: Replace NOLOCK with a Safer Isolation Strategy

  • On Windows Server 2025, open SQL Server Configuration Manager to confirm the instance is running SQL Server 2025 build 17.x or later.
  • Enable Read Committed Snapshot Isolation (RCSI) instead of relying on NOLOCK:
ALTER DATABASE YourDatabase 
SET READ_COMMITTED_SNAPSHOT ON;
  • Update application connection strings or stored procedures to remove WITH (NOLOCK) hints where consistency matters.

Step 4: Rebuild Indexes to Clear Fragmentation

  • If adding a clustered index isn’t immediately feasible, rebuild existing indexes to reduce data movement frequency:
ALTER INDEX ALL ON dbo.YourTableName REBUILD;
  • Schedule this via SQL Server Agent during low-traffic windows to minimize future scan interruptions.

Alternative or Verification Steps

  • Re-run the original query with WITH (NOLOCK) under load-testing conditions (using a tool like ostress.exe) to confirm Error 601 no longer appears in the SQL Server Error Log (C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG).
  • If the clustered index cannot be added due to application constraints, switch queries to use WITH (READPAST) or standard locking to bypass dirty-read scan failures entirely.

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

Troubleshooting Guide: SQL Server Error 597 – In-Proc Data Access Terminated Due to UDP Errors

Why This Error Happens

Error 597 occurs when SQL Server’s in-process data access layer encounters communication failures over the User Datagram Protocol, typically caused by SQL Browser service disruptions or blocked UDP port 1434. This is often triggered by corrupted CLR assemblies, misconfigured Windows Firewall rules on Windows Server 2025/Windows 11, or a conflict between multiple SQL Server instances attempting to broadcast on the same UDP channel. In some cases, outdated network drivers or incomplete Service Pack installations can also corrupt the internal UDP handshake process used by SQL Server’s discovery service.

Step-by-Step Resolution Guide

Step 1: Verify and Restart the SQL Server Browser Service

  • Open Services.msc on Windows Server 2025 and locate “SQL Server Browser.”
  • Confirm the service startup type is set to Automatic rather than Disabled.
  • Right-click and select Restart; monitor Event Viewer for Event ID 597 recurrence.
  • Run net start SQLBrowser from an elevated Command Prompt if the GUI restart fails.

Step 2: Check and Unblock UDP Port 1434 in Windows Firewall

  • Navigate to Windows Defender Firewall with Advanced Security.
  • Inspect Inbound Rules for an entry named “SQL Server Browser Service” or similar.
  • Ensure the rule allows UDP port 1434 and is scoped correctly to your domain/private profile.
  • If missing, create a new rule: netsh advfirewall firewall add rule name="SQLBrowserUDP" dir=in action=allow protocol=UDP localport=1434.

Step 3: Repair or Rebuild the CLR Integration Components

  • Open SQL Server Management Studio (SSMS) and run:
  EXEC sp_configure 'clr enabled', 1;
  RECONFIGURE;
  • If CLR assemblies appear corrupted, drop and re-register them using ALTER ASSEMBLY with the WITH REBUILD option.
  • Restart the SQL Server service afterward via net stop MSSQLSERVER && net start MSSQLSERVER.

Step 4: Validate Network Adapter and Driver Configuration

  • Open Device Manager and check for outdated network adapter drivers flagged with a warning icon.
  • Update drivers via Windows Update or manufacturer-provided installers.
  • Disable any conflicting virtual adapters (e.g., Hyper-V virtual switches) temporarily to isolate the UDP conflict.

Alternative or Verification Steps

  • After applying fixes, generate test traffic using sqlcmd -S ServerName\InstanceName -Q "SELECT @@VERSION" to confirm the in-proc data access completes without triggering Error 597 in the Application log.
  • If the issue persists, consider switching client connections to use a static TCP port instead of relying on UDP-based SQL Browser discovery, bypassing the UDP layer entirely.

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

Troubleshooting Guide: SQL Server Error 598 During CREATE/ALTER DB

Why This Error Happens

Error 598 is a generic wrapper error indicating that SQL Server 2025 encountered a failure while processing a CREATE DATABASE or ALTER DATABASE statement, but the actual root cause is logged as a separate, preceding error in the SQL Server error log. This typically stems from insufficient file-system permissions for the SQL Server service account on the target data/log directory, a filename or path conflict (such as an existing file, invalid drive letter, or a path exceeding OS limits), or insufficient disk space on the target volume. In some cases, it can also result from corrupted or inaccessible FILESTREAM containers or a conflict with Windows Server 2025’s stricter file-locking policies.

Step-by-Step Resolution Guide

Step 1: Locate the Preceding Error in the SQL Server Log

  • Open SQL Server Management Studio (SSMS) and connect to the instance.
  • Navigate to Management > SQL Server Logs > Current, or query directly using:
  EXEC sp_readerrorlog 0, 1, 'CREATE DATABASE';
  • Identify the specific error code immediately preceding Error 598 (common companions include Error 5133, 5123, or 1802).

Step 2: Verify File System Permissions and Path Validity

  • Confirm the SQL Server service account (e.g., NT Service\MSSQLSERVER or a custom domain account) has Full Control on the target directory, typically:
  C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA
  • Check Windows Security settings via Right-click folder > Properties > Security > Edit, and add the service account if missing.
  • Ensure the specified path exists and does not contain restricted characters or exceed 260 characters (unless long path support is enabled in Windows Server 2025).

Step 3: Check Disk Space and Volume Health

  • Run Get-PSDrive in PowerShell to confirm the target volume has sufficient free space (SQL Server requires headroom beyond the initial file size for log growth).
  • Use chkdsk C: /f (adjust drive letter) during a maintenance window if volume corruption is suspected.
  • Restart the SQL Server service via services.msc or net stop MSSQLSERVER && net start MSSQLSERVER if the disk was repaired.

Step 4: Rebuild or Relocate the Database Files

  • If the target file path was previously used by a corrupted or orphaned database, rename or delete the stale .mdf/.ldf files after confirming they aren’t referenced elsewhere.
  • Retry the CREATE DATABASE command pointing to a clean, verified path:
  CREATE DATABASE TestDB
  ON (NAME = TestDB_Data, FILENAME = 'C:\SQLData\TestDB.mdf')
  LOG ON (NAME = TestDB_Log, FILENAME = 'C:\SQLData\TestDB.ldf');

Alternative or Verification Steps

  • Verify the fix by successfully executing the CREATE/ALTER DB statement and confirming the database appears in sys.databases with state_desc = 'ONLINE'.
  • If the error persists, run the operation with a minimally scoped test (new database, default path) to isolate whether the issue is environmental (permissions/disk) or specific to the original script’s syntax or file specification.