Using

To see the query plan for a query, use:

set showplan on

To stop displaying query plans, use:

set showplan off

You can use showplan in conjunction with other set commands.

When you want to display showplans for a stored procedure, but not execute them, use the set fmtonly command.

See Chapter 4, “Query Tuning Tools,” in Performance and Tuning: Optimizer for information on how options affect each other’s operation.

NoteDo not use set noexec with stored procedures � compilation and execution will not occur and you will not get the necessary output