Home » SQL Server » SQL Server || Query Execution plan from XML to Graphical View

SQL Server || Query Execution plan from XML to Graphical View


1) We can get queries execution plan from below query

SELECT

–st.text, qs.EXECUTION_COUNT

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

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

Advertisements

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: