Is it possible to force a query to use a specific Index?
|
|
|
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 |
|