,
Share with your friends 

Is it possible to force a query to use a specific Index?

7 ratings Views 128 
Author: vetri_beca605d (vetri vijayan)  View Profile |  View other solutions by this author

Question / Problem


Is it possible to force a query to use a specific Index?

Solution

Yes.We can achieve this using the following example query.

Syntax:

SELECT column1 , column2
FROM TableName (INDEX (idx_column1, idx_column2))

Example:

SELECT ProductID FROM sales.SalesOrderDetail 
WITH (INDEX ( IX_SalesOrderDetail_ProductID))

Applies to

Microsoft SQL Server 2005

Rank It

Login to rank it

Report


Advertisement