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

Troubleshooting Guide: Error 11435 — “%S_MSG option is not supported for Heaps”

Why This Error Happens

This error occurs when a Transact-SQL statement attempts to apply an index-specific option—such as ONLINE, SORT_IN_TEMPDB, MAXDOP restrictions tied to rebuild operations, or a compression/partitioning clause intended for indexed structures—to a table that is organized as a Heap (a table without a clustered index). Because heaps lack the B-tree structure required to support rebuild or reorganize semantics, SQL Server rejects the operation at parse/validation time. This commonly surfaces when maintenance scripts, third-party index management tools, or Ola Hallengren-style maintenance plans are executed generically against all tables without checking whether a table actually has a clustered index first.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Table and Statement

  • Capture the full error message, which includes the table name in the '%.*ls' placeholder.
  • Run the following query to confirm the table is a Heap (index_id = 0 indicates no clustered index):
SELECT t.name AS TableName, i.type_desc, i.index_id
FROM sys.tables t
JOIN sys.indexes i ON t.object_id = i.object_id
WHERE i.index_id = 0 AND t.name = 'YourTableName';
  • Note the exact T-SQL command (ALTER INDEX, index rebuild job step, or maintenance plan task) that triggered the failure.

Step 2: Correct the T-SQL Syntax for Heap-Compatible Operations

  • Remove the unsupported option from the statement. Heaps do not support REORGANIZE, ONLINE = ON rebuilds, or certain DATA_COMPRESSION syntax variants tied to index rebuild context.
  • If the intent was to defragment or compress the table, use the heap-safe equivalent:
ALTER TABLE YourTableName REBUILD WITH (DATA_COMPRESSION = PAGE);
  • Avoid wrapping heap tables in ALTER INDEX ALL ON TableName REBUILD WITH (...) scripts that assume every table has a clusterable index structure.

Step 3: Update Maintenance Scripts or Jobs to Skip Heaps Appropriately

  • Open the SQL Agent Job, Maintenance Plan, or third-party script (e.g., Ola Hallengren’s IndexOptimize) responsible for the failure.
  • Add a filter to exclude heaps from index-specific maintenance logic, for example:
WHERE EXISTS (
    SELECT 1 FROM sys.indexes i
    WHERE i.object_id = t.object_id AND i.index_id > 0
)
  • If using Ola Hallengren’s scripts, ensure you’re on a version patched for SQL Server 2025 compatibility, as older versions may mishandle heap detection logic.

Step 4: Consider Adding a Clustered Index (Optional Long-Term Fix)

  • If the table is frequently targeted by rebuild/reorganize jobs, evaluate whether it should have a clustered index instead of remaining a heap.
  • Adding a clustered index resolves the root ambiguity permanently and often improves query performance:
CREATE CLUSTERED INDEX IX_YourTableName_PK ON YourTableName (YourKeyColumn);

Alternative or Verification Steps

  • Re-run the corrected script or job step and confirm it completes without Error 11435 in the SQL Server Error Log or Job History.
  • As a quick alternative, wrap heap-targeting statements in a conditional check using OBJECTPROPERTY(OBJECT_ID('TableName'), 'TableHasClustIndex') to dynamically skip unsupported operations in automated scripts.