Explain Composite Index in SQL Server.

 Posted by CGN007 on 6/21/2012 | Category: Sql Server Interview questions | Views: 4424 | Points: 40

In SQL 2005 and 2008 we can add up to 16 columns in a index. Such index that consists of more than one columns is referred as composite index.
Both clustered and non-clustered indexes can be composite index.The order of the columns are very important here.

CREATE INDEX index_name

ON [table_name] (col1,col2,...col16);

For example.
 CREATE INDEX IX_Student_Composite

ON [Student] (student_Code,student_Name);

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response