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

Troubleshooting Guide: SQL Server Error 5235 — DBCC Command Terminated Abnormally

Why This Error Happens

Error 5235 occurs when a DBCC command (such as DBCC CHECKDB, CHECKTABLE, or CHECKALLOC) is interrupted before completion, typically due to an internal error state triggered by database corruption, insufficient tempdb space, or a killed session/connection timeout. This error is frequently seen on SQL Server 2025 instances running on Windows Server 2025 when the underlying storage subsystem experiences I/O latency spikes or when the DBCC process is manually terminated via KILL command or client disconnection. In some cases, this is also a symptom of insufficient memory grants causing the internal consistency check worker threads to fail mid-execution.

Step-by-Step Resolution Guide

Step 1: Verify the SQL Server Error Log and Event Viewer

  • Open SQL Server Management Studio (SSMS) and navigate to Management > SQL Server Logs.
  • Cross-reference the exact error state number (the %d value) with Microsoft’s documented DBCC error states list to identify if it’s a corruption-related state (e.g., state 1, 4, 8) or an environmental state (e.g., state 11, 12).
  • Check Windows Event Viewer under Applications and Services Logs > MSSQLSERVER for correlating I/O or memory warnings around the same timestamp.

Step 2: Check TempDB Space and Configuration

  • Run the following query to confirm tempdb isn’t running out of space, which is a leading cause of DBCC termination:
SELECT name, size/128.0 AS size_MB, max_size, growth 
FROM tempdb.sys.database_files;
  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\ (adjust version path for SQL Server 2025) and ensure the drive hosting tempdb has at least 20-30% free space.
  • If space is low, add an additional tempdb data file or expand the existing file via SSMS > Database Properties > Files.

Step 3: Rule Out Manual Termination or Timeout Conflicts

  • Confirm no automated job, monitoring tool, or administrator issued a KILL command against the DBCC session ID during execution.
  • Check for any configured query governor cost limit or remote query timeout settings in Server Properties > Connections that may be prematurely closing long-running DBCC sessions.
  • Increase the client connection timeout value in your application or SSMS connection properties if DBCC is being run interactively and timing out.

Step 4: Run DBCC CHECKDB with Repair Options (If Corruption Confirmed)

  • If the error state correlates to actual corruption, take the database offline or set it to single-user mode:
ALTER DATABASE [YourDB] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DBCC CHECKDB ('YourDB', REPAIR_ALLOW_DATA_LOSS);
ALTER DATABASE [YourDB] SET MULTI_USER;
  • Always restore from a verified backup first if data loss is unacceptable, using repair only as a last resort.

Alternative or Verification Steps

  • Re-run DBCC CHECKDB during a low-activity window and monitor it to completion using sys.dm_exec_requests to confirm the percent_complete column progresses without interruption.
  • If the issue persists, restore the database to a separate instance from the last known good backup and run DBCC CHECKDB there to isolate whether the root cause is environmental (Windows Server 2025 host) or data-level corruption.