QUERY HINT USE PLAN N'xml_plan'
Forces the Query Optimizer to use an existing query plan for a query specified by xml_plan.
What changes
- Input
- none
- Output or change
- none
Syntax at a glance
OPTION ( USE PLAN N'xml_plan' )
Work example
A measured plan issue may justify investigating QUERY HINT USE PLAN N'xml_plan' for one known query shape.
Save the actual plan and runtime metrics first. Test representative parameter values and remove the hint if the plan no longer fits.
Check your work QUERY HINT USE PLAN N'xml_plan'. The plan property affected by QUERY HINT USE PLAN N'xml_plan' changes as intended and reads, duration, and result rows remain acceptable.
Open Microsoft Learn for full syntax, permissions, and details for your version.