May 1, 2007 at 1:33 pm
I am not sure what the best forum is for my question, but here it is:
If I am writing a SQL query (which will be invoked from a .Net program), calling upon a Progress db via an ODBC link, and I want to specify that the query use a non-primary key index on the Progress side, how can I do that in T-Sql?
Thanks for all ideas and suggestions.
May 2, 2007 at 7:31 am
a better explanation of index hints than BOL supplies can be found here:
http://www.sqlservercentral.com/columnists/rmarda/performanceaddinghints_printversion.asp
it's bad to second guess SQL Server's abilities as far as deciding which index to use, but here is the syntax:
SELECT *
FROM authors WITH (INDEX(0))
Using ID of 0 for the index ID will force SQL Server to perform a clustered index scan if a clustered index exists. If there is no clustered index then a table scan will be done.
Here is an example that uses an index name instead of an ID:
USE pubs
SELECT *
FROM authors WITH (INDEX(aunmind))
Lowell
May 2, 2007 at 8:10 am
Lowell, thanks for your reply! I think that will help and I will pass along the suggestion to our Progress people.
One note: I was unable to get into the link you sent. I was able to find a list of "rmarda"'s articles but the one you quote isn't on that list.
May 2, 2007 at 8:33 am
i fat fingered the link and added a backslash..sorry.
I edited the link and it does take me to the right spot now.
Lowell
May 2, 2007 at 8:43 am
Thanks again, Lowell. I found it now.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy