Hi friends is there a query something like select * from [stored proc]
which returns execution plan of SQL statement in XML format...I don't want to use SSMS.
You can get the XML query plan by using sys.dm_exec_cached_plans and sys.dm_exec_text_query_plan .
select x.query_plan
from sys.dm_exec_cached_plans as p
cross apply sys.dm_exec_text_query_plan(p.plan_handle, 0, -1) as x
where p.objtype = 'proc' and
x.objectid = object_id('StoredProcName', 'P')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.