Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to use with index query hint in SQL Server Joins

Posted on 2010-08-18
3
Medium Priority
?
375 Views
Last Modified: 2012-05-10
Im tyring to use with index clause in SQL Server Joins but getting syntax errors. on SQL 2005

Can someone helpout with a sample
0
Comment
Question by:dba2dba
  • 2
3 Comments
 
LVL 58

Expert Comment

by:cyberkiwi
ID: 33465029
select * from tbl with (index(indexname,index2name))
select * from tbl with (index(indexname))
select * from tbl t1 with (index(indexname)) inner join tbl2 .....

put the with(index()) next to the table after the alias
0
 
LVL 58

Expert Comment

by:cyberkiwi
ID: 33465052
http://msdn.microsoft.com/en-us/library/ms187373.aspx

section INDEX

INDEX ( index_value [ ,... n ] ) | INDEX = (index_value)
0
 
LVL 16

Accepted Solution

by:
vdr1620 earned 2000 total points
ID: 33465171
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question