How to fix Error 7436 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 7436 — FORCESEEK/FORCESCAN Hints with Remote Data Sources

Why This Error Happens

This error occurs because the query optimizer does not support table hints such as FORCESEEK or FORCESCAN when the query references a linked server or remote data source. These hints require direct control over local index access paths, which SQL Server cannot guarantee or enforce on a remote provider. This typically surfaces in distributed queries, four-part naming references (Server.Database.Schema.Table), or OPENQUERY/OPENROWSET calls where a developer has manually added indexing hints intended for local tables.

Step-by-Step Resolution Guide

Step 1: Identify the Offending Query

  • Capture the exact query text from the error message or SQL Server error log (Event ID 7436).
  • Use SQL Server Management Studio (SSMS) to run the query in isolation and confirm it references a linked server via four-part naming (e.g., [LinkedServerName].[DB].[dbo].[Table]).
  • Check if FORCESEEK, FORCESEEK (IndexName (Columns)), or FORCESCAN hints are present in the WITH () clause of the table reference.

Step 2: Remove or Replace the Invalid Hints

  • Edit the query and delete the FORCESEEK or FORCESCAN hint directly from the affected table reference.
  • If the intent was to force a specific index, instead apply the hint on a local temp table after importing the remote data (e.g., stage data via SELECT INTO #TempTable and apply hints there).
  • Save the corrected query in your stored procedure, view, or application code repository.

Step 3: Validate Linked Server Configuration

  • Open SSMS and navigate to Server Objects > Linked Servers to confirm the remote source is correctly configured.
  • Run EXEC sp_testlinkedserver 'LinkedServerName'; to ensure connectivity is stable and not causing the optimizer to generate unsupported plans.
  • Review sys.servers and sys.linked_logins to confirm provider options (like RPC OUT) are properly enabled if remote procedure calls are involved.

Step 4: Update Application or ORM-Generated Queries

  • Search backend application code, Entity Framework migrations, or dynamic SQL generators for auto-injected hints targeting linked tables.
  • On Windows Server 2025, check scheduled SQL Agent jobs under SQL Server Agent > Jobs for legacy scripts that may still contain these hints from older SQL Server versions.
  • Redeploy the corrected stored procedures using sqlcmd or SSMS Deployment Wizard.

Alternative or Verification Steps

  • Re-run the original query after removing the hints and confirm Error 7436 no longer appears in SSMS or the Windows Event Viewer (Application Log).
  • If index performance was the original goal, use the OPTION (OPTIMIZE FOR) query hint or create an indexed view locally instead, as these alternatives are compatible with remote data source queries.