Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to use filtered index in sql server on a table where one table has multiple row with single corresponding Id(geteroryId), and this Id always will come in where clause so how I can implement non clustered index on this column

What I have tried:

The query will be like this,
SQL
select quntity from table name where geteroryId = 2


I just want to implement index on quantity column..Please help.
Posted
Updated 12-Aug-17 1:27am
Comments
Kornfeld Eliyahu Peter 7-Aug-17 16:13pm    
Why to set an index on that column? It will help nothing...
Jyoti Kumari96 7-Aug-17 16:16pm    
OK. Thanks,
And if I implement index on geteroryId column then how can write query. ?
Kornfeld Eliyahu Peter 7-Aug-17 16:18pm    
You need not change the query...
Add the index to table using CREATE INDEX...
ZurdoDev 8-Aug-17 9:23am    
An index helps the SQL engine find data faster. Putting it on a quantity column will not likely help much.

1 solution

Create NonClustered Index [NOC_CategoryID] on tablename geteroryId ASC 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900