Home » CodeProject » Query Execution Plan from XML to Graphical View

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/)

Advertisements

1 Comment

  1. David Atkinson says:

    Another option is to paste the XML into http://sqltuneup.sqlservercentral.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: