Home » Posts tagged 'execution plan'

Tag Archives: execution plan

Query Execution Plan from XML to Graphical View

Convert Your SQL Server Query Execution Plan from XML to Graphical View

1) We can get queries execution plan from below query

SELECT

QS.*, CP.*

FROM SYS.DM_EXEC_QUERY_STATS AS QS

CROSS APPLY SYS.DM_EXEC_SQL_TEXT(SQL_HANDLE)AS ST

CROSS APPLY SYS.DM_EXEC_QUERY_PLAN(PLAN_HANDLE) AS CP

2) Column query_plan is having execution plan in XML form

3) When we click hyperlink in query_plan column, in SQL 2005,2008 & 2008 R2 it open as XML but in SQL 2012 it converted to graphical view

aaa

 

4) To convert XML to graphical view, save XML file with extension .sqlplan & open it with SSMS

5) Now plan will show in graphical view

 

If you liked this post, do like on Facebook at http://www.facebook.com/mssqlfun

Reference : Rohit Garg (http://mssqlfun.com/)

LinkedIn Auto Publish Powered By : XYZScripts.com
%d bloggers like this: