SQL Flow Field Guide

JOIN HINT { LOOP | HASH | MERGE }

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

Applies to: Azure SQL Database, Azure SQL Managed Instance, SQL analytics endpoint in Microsoft Fabric, SQL database in Microsoft Fabric, Microsoft Fabric Warehouse in Microsoft Fabric

What changes

Input
none
Output or change
none

Syntax at a glance

<join_type> { LOOP | HASH | MERGE } JOIN

Work example

A measured query issue may justify testing JOIN HINT { LOOP | HASH | MERGE } 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 JOIN HINT { LOOP | HASH | MERGE }. The intended plan behavior for JOIN HINT { LOOP | HASH | MERGE } is visible and the result rows are unchanged across the comparison.

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