← Back to Gists

INDEX with included columns

📝 SQL
margaretzimmerman
margaretzimmerman · Level 8 ·

Creates a non-clustered index that stores additional column data at the leaf level to cover queries without accessing the table.

SQL
CREATE INDEX IXOrdersCustomerIdInclude
ON Orders (CustomerId)
INCLUDE (OrderDate, TotalAmount);

Comments

No comments yet. Start the discussion.