I have 2 questions....
1) in the query below, the index is not used unless the WITH clause is supplied. How can I get the query to use that index automatically? There are 3 indexes; one for each of the columns (From_Column, To_Column) and an index with both columns
2) In its present state, the query still takes too long to run (sometimes 1 sec). I have a list of numbers (up to 200 rows) and I need to call this query for each number in the list. This could take up to 3 minutes to run. What changes (process, query, indexes) need to be made to get this process to run quickly?
@inNum = 23568978
from Table01 WITH (INDEX = Table01_Index01)
@inNum>= From_Column AND