Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sponguru_dba
Yak Posting Veteran
93 Posts |
Posted - 2007-01-03 : 09:45:59
|
Hi allHow to enforce the index to Select Statementsyntax i went through BOL i never find(i may missied) can some helpsyntax forselect a,b,c,d,e,f from x,y,zI h've index's on x only those ate indx1,indx2,indx3 now i want use indx2Thank in AdvanceSreenivasaRaoSreenivasaRaoBangalore,INDIA |
|
Kristen
Test
22859 Posts |
Posted - 2007-01-03 : 10:08:31
|
SQL Server will use the index that it considers most efficient for a particular query. It is very rare to need to override this, and thus doing so generally is not Best Practice (because if you think you need to do it the likelihood is that you have missed something else!)However, there are exceptions. Personally I can only think of one instance where I have forced a query to use a specific index - and I write a lot of queries in a year, and I've been doing it for a lot of years! Even allowing for my poor aged memory, its still a very rare event IME.select a,b,c,d,e,f from x,y,z WITH (INDEX(indx2))Might be an idea if you post the query here and then folk can give you advice.Kristen |
 |
|
sponguru_dba
Yak Posting Veteran
93 Posts |
Posted - 2007-01-03 : 10:40:03
|
HiThanks Kristen,thanks for AdviceSreenivasaRaoBangalore,INDIA |
 |
|
|
|
|
|
|