execution plans

  • hello, i have a question

    i know if i enable SET STATISTICS PROFILE ON

    everytime i run queries, it popups a new table with the actual execution plan.

    theres any function that i write the plan_handle and it writes for me the execution plan in text mode ? (with SET STATISTICS PROFILE OFF)

  • You can query the cache, but the output is XML, not text. The DMO you need is sys.dm_exec_query_plan. It needs a plan handle. You can get those from sys.dm_exec_query_stats, sys.dm_exec_procedure_stats or sys.dm_exec_requests.

    I would not use the text style plans. They've been on the deprecation list for a while and soon will no longer be available.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply