Use index hints in Microsoft SQL Server

Example of using Index hint in the query of Microsoft SQL Server

Check the query without using index hints:

select * from [HumanResources].[Employee]

Use index hint to forcefully use the index by executing SQL query:

Syntax: With (index = indexname)

Example:
select * from [HumanResources].[Employee] with (index =  [AK_Employee_LoginID])

1 thought on “Use index hints in Microsoft SQL Server

  1. Pingback: Best Choice mssql hint use index Update New - #1 Website cung cấp thông tin công nghệ mới nhất VN

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.