Is it possible to force seek with index name?

sakuraime 2,341 Reputation points
2020-11-14T04:47:59.313+00:00

Is it possible to force seek with index name?

SELECT SalesOrderID, OrderDate, CustomerID, TotalDue, OnlineOrderFlag
FROM Sales.SalesOrderHeader WITH (FORCESEEK,INDEX(IX_INDEXNAME))
WHERE OrderDate >= @START _date

SQL Server Other
{count} votes

Accepted answer
  1. Dan Guzman 9,401 Reputation points
    2020-11-14T15:50:21.123+00:00

    i just want to know the correct syntax

    The table hint documentation reference suggests your syntax is correct. Below is an example code snippet from the FORCESEEK section that shows usage combining FORCESEEK and an INDEX hint:

    FROM dbo.MyTable WITH (FORCESEEK, INDEX (MyIndex))  
    
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.