>>I have this query
>>
>>
>>....
>>left outer join dbo.accounts a on a.acct_name = t.acct_name
>> left outer join dbo.transact r WITH (index = sale_no) on r.sale_no = t.sale_no
>>
>>
>>Note the WITH (index = nameOfTheIndex)
>>
>>clause.
>
>Thanks, is this SQL ANSI compliant? Also, does this syntax apply also to a WHERE clause?
It can be used in SQL Server. I'm not sure such hints can be used in other database languages.
BTW, you can investigate Query Hints topic in BOL.
If it's not broken, fix it until it is.
My Blog