sql server - Include additional columns in a non clustered primary key index -
i have defined primary key on table nonclustered
. non-clustered indexes explicitly created create nonclustered index
possible include additional (non-indexed) columns. same possible implicitly created primary key non-clustered index?
the syntax include columns available create nonclustered index, specifically
include (column [ ,... n ] ) specifies non-key columns added leaf level of nonclustered index. nonclustered index can unique or non-unique.
is not available add constraint, cannot include columns primary key, if non-clustered.
a primary key useful unique identifier record, , candidate key available referential constraints. however, performance reasons, if have clustering key on column , have no other candidate keys promote pk, can create additional non-clustered index on primary key column(s) , include other columns onto index.
Comments
Post a Comment