In which situation the sql server use the index?
i sure table has employee no. columns nad has primary key .if yes , should create non-clustered index in salary column , including select columns in include section should suffice ..
if dont have primary key on column make clustered index on employee no. column used in of queries .primary key creates clustered index .
if query : select * employee salary between 10000 , 20000 create non-clustered index on salary .
if query : select name , age employee salary between 10000 , 20000 create non-clustered index on salary , include name , age columns in index (this fro 2005 , above).
abhay chaudhary ocp 9i, mcts/mcitp (sql server 2005, 2008, 2005 bi) ms-abhay.blogspot.com/
SQL Server > SQL Server Database Engine
Comments
Post a Comment