I use a similar query like this
select.....from.. with... (INDEX=IX_TABLE_1, INDEX=IX_TABLE_2)...
I get the following error
Only one list of index hints per table
is allowed
This seems to be working well with SQL Server 2005. Is it an issue with SQL server?
I think it may be because of the syntax you’re using.
Instead of (INDEX=IX_TABLE_1, INDEX=IX_TABLE_2), try:
I think it is the fact you have 2 “INDEX=” parts.
Also, I would recommend only using index hints as a last resort as the query optimiser should generally choose the best plan/indexes to use. This is why generally, you should trust the optimizer. If you do use index hints, it’s a good idea to review them fairly frequently as they may become worse over time (e.g. as data volumes grow, what did originally perform better with the hint, may start performing worse).