Monday, September 9, 2024

How do I enable a query execution plan in SQL Server?

  To enable the execution plan for a query, run:

SET SHOWPLAN_ALL ON;

Then run your query. The execution plan will be displayed as part of the result. To turn off the execution plan, use:

SET SHOWPLAN_ALL OFF;