Troubleshooting Guide: Error 10601 – Cannot Specify Included Columns for a Clustered Index
Why This Error Happens
SQL Server Error 10601 occurs because the INCLUDE clause is only valid for nonclustered indexes, not clustered indexes. A clustered index already physically contains all columns of the table in its leaf level, so there is no concept of a “included” (non-key) column to add separately. This error typically surfaces when a CREATE INDEX or CREATE TABLE script incorrectly applies the INCLUDE syntax to a CLUSTERED index definition, often due to copy-pasted T-SQL templates or auto-generated scripts from migration tools.
Step-by-Step Resolution Guide
Step 1: Identify the Offending T-SQL Statement
- Locate the exact
CREATE INDEXorALTER TABLEstatement that triggered Error 10601 in SSMS or your deployment log. - Check whether the index definition contains both the
CLUSTEREDkeyword and anINCLUDE (...)clause in the same statement. - Example of invalid syntax:
CREATE CLUSTERED INDEX IX_Orders_Date
ON dbo.Orders (OrderDate)
INCLUDE (CustomerID);
Step 2: Decide on the Correct Index Strategy
- Determine if you actually need a clustered index (defines physical row order) or a nonclustered index (separate structure with optional included columns).
- If you need included columns for query performance (covering index), switch the index type to
NONCLUSTERED. - If you truly need a clustered index, remove the
INCLUDEclause entirely since all columns are already “included” by definition.
Step 3: Rewrite the Index Definition
- For a covering index with included columns, use:
CREATE NONCLUSTERED INDEX IX_Orders_Date
ON dbo.Orders (OrderDate)
INCLUDE (CustomerID);
- For a pure clustered index without included columns, use:
CREATE CLUSTERED INDEX IX_Orders_Date
ON dbo.Orders (OrderDate);
- Save and re-run the corrected script in SSMS or your deployment pipeline (SSDT/DACPAC, Flyway, etc.).
Step 4: Audit Related Scripts and Templates
- Search your source control repository (Git, TFVC) for similar
CREATE CLUSTERED INDEX ... INCLUDEpatterns using a text search across.sqlfiles. - Update any shared index-generation templates or ORM migration scripts (Entity Framework, Liquibase) that may have produced the invalid syntax.
- Re-validate automated database build pipelines on Windows Server 2025 to ensure the corrected scripts are used going forward.
Alternative or Verification Steps
- Verify the fix by re-executing the corrected
CREATE INDEXstatement in SSMS connected to your SQL Server 2025 instance — it should complete without Error 10601, and you can confirm the index type viasys.indexes(type_desccolumn should showCLUSTEREDorNONCLUSTEREDas expected). - If you are unsure whether columns should be key columns or included columns, as an alternative, create the clustered index on the key columns only, then add a separate nonclustered covering index with the
INCLUDEclause for the additional columns needed by your queries.