Solved

how to use with index query hint in SQL Server Joins

Posted on 2010-08-18
3
361 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 500 total points
ID: 33465171
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now