Re: Need help with hint syntax in SQL Server 2000
- From: Mark D Powell <Mark.Powell@xxxxxxx>
- Date: Tue, 9 Dec 2008 08:22:18 -0800 (PST)
On Dec 6, 11:00 am, Erland Sommarskog <esq...@xxxxxxxxxxxxx> wrote:
Mark D Powell (Mark.Pow...@xxxxxxx) writes:
Blast. Based on < table_hint > ::=
{ INDEX ( index_val [ ,...n ] )
I was doing: with index (index_name)
There are just too many ways to specify index hints!
What you missed was the extra layer of parenthesis, found higher up
in the topic. This is what you should try:
WITH (INDEX (myindex))
I see that the syntax I suggested is not in Books Online 2000, but it
appears in Books Online 2008, although it seem to suggest that I should
say:
WITH (INDEX = (myindex))
Nevertheless, I am quite sure that my original proposal works.
I know a FROM (table) hint on a query against a view is propogated to
the tables in the view but will an index hint propogate or will I have
to place the hint into the view itself?
I think you will have to stick the hint in the view itself. Which is
something I would try to avoid. But try using the query as such with
the hint and see if it helps.
But run UPDATE STATISTICS WITH FULLSCAN on the tables first.
--
Erland Sommarskog, SQL Server MVP, esq...@xxxxxxxxxxxxx
Links for SQL Server Books Online:
SQL 2008:http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005:http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000:http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Thank you for the update. I did not get to work on this yesterday but
I intend to try to test today.
-- Mark D Powell --
.
- Follow-Ups:
- Re: Need help with hint syntax in SQL Server 2000
- From: Mark D Powell
- Re: Need help with hint syntax in SQL Server 2000
- References:
- Need help with hint syntax in SQL Server 2000
- From: Mark D Powell
- Re: Need help with hint syntax in SQL Server 2000
- From: Erland Sommarskog
- Re: Need help with hint syntax in SQL Server 2000
- From: Mark D Powell
- Re: Need help with hint syntax in SQL Server 2000
- From: Erland Sommarskog
- Need help with hint syntax in SQL Server 2000
- Prev by Date: Re: Need help with hint syntax in SQL Server 2000
- Next by Date: Re: Dynamic SQL
- Previous by thread: Re: Need help with hint syntax in SQL Server 2000
- Next by thread: Re: Need help with hint syntax in SQL Server 2000
- Index(es):
Relevant Pages
|