How to Create an Index in SQL Server

Last updated July 25, 2026 · By the SaturnSQL team

CREATE INDEX name ON table (columns) builds a nonclustered index. Add INCLUDE (columns) to cover a query, so SQL Server answers it from the index alone without key lookups.

CREATE INDEX ix_orders_customer_id
ON orders (customer_id);

Covering index with INCLUDE

CREATE INDEX ix_orders_customer_created
ON orders (customer_id, created_at)
INCLUDE (amount, status);

Key column order matters: put equality-filtered columns first, range or sort columns after. On Enterprise edition and Azure SQL, add WITH (ONLINE = ON) to avoid blocking writes during the build.

Run this in SaturnSQL

SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.

Try it free

Related SQL Server guides

© 2026 Panda Capital Oy Ab. All rights reserved.