SQL Flow Field Guide

QUERY HINT TABLE HINT ( exposed_object_name [ , <table_hint> [ [ , ] ...n ] ] )

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

Applies the specified table hint to the table or view that corresponds to exposed_object_name.

What changes

Input
none
Output or change
none

Syntax at a glance

OPTION ( TABLE HINT ( exposed_object_name [ , <table_hint> [ [ , ] ...n ] ] ) )

Work example

A measured query issue may justify testing QUERY HINT TABLE HINT ( exposed_object_name [ , <table_hint> [ [ , ] ...n ] ] ) against the optimizer's default choice.

Capture the current plan, rows, reads, and elapsed time. Change one hint in a test copy and compare the same parameter values.

Check your work QUERY HINT TABLE HINT ( exposed_object_name [ , <table_hint> [ [ , ] ...n ] ] ). The intended plan behavior for QUERY HINT TABLE HINT ( exposed_object_name [ , <table_hint> [ [ , ] ...n ] ] ) is visible and the result rows are unchanged across the comparison.

Open Microsoft Learn for full syntax, permissions, and details for your version.