February 23, 2012 at 5:35 am
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)
February 23, 2012 at 12:32 pm
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