I'm trying to execute the following command to force an update to use a non-clustered index:
UPDATE Flights
SET Airtime=5555678
WHERE Distance=10000
OPTION (TABLE HINT(Flights, INDEX (DistanceIndex)))
... and it's erroring:
Msg 8724, Level 16, State 1, Line 75
Cannot execute query. Table-valued or OPENROWSET function 'Flights' cannot be specified in the TABLE HINT clause.
I can't find any clear advice on how the syntax should be properly formed inside the TABLE HINT
statement.
Please can anyone advise where I'm going wrong?