Why use the INCLUDE clause when creating an index?
Posted
by Cory
on Stack Overflow
See other posts from Stack Overflow
or by Cory
Published on 2009-08-20T18:27:18Z
Indexed on
2010/05/07
11:18 UTC
Read the original article
Hit count: 194
While studying for the 70-433 exam I noticed you can create a covering index in one of the following two ways.
CREATE INDEX idx1 ON MyTable (Col1, Col2, Col3)
-- OR --
CREATE INDEX idx1 ON MyTable (Col1) INCLUDE (Col2, Col3)
The INCLUDE clause is new to me. Why would you use it and what guidelines would you suggest in determining whether to create a covering index with or without the INCLUDE clause?
© Stack Overflow or respective owner