Sqlserver-dba.com

SET SHOWPLAN ON

Use SET SHOWPLAN_XML  instead of  SET SHOWPLAN_TEXT or SET SHOWPLAN_ALL. Microsoft announced at the  SQL Server 2008  release ,  SET SHOWPLAN_TEXT and  SET SHOWPLAN_ALL are deprecated

 The advantage of using SET SHOWPLAN_XML  ON  is  that the code is not executed.  Executing the t-sql returns the execution plan.

SET SHOWPLAN_XML ON
GO
select sql_handle from sys.dm_exec_query_stats
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS s2 
GO
SET SHOWPLAN_XML OFF

Turn the option off by   SET SHOWPLAN_XML  OFF .

 If using the Results to Grid , the output is :

Xml showplan

 

Clicking on the link , displays the Execution Plan.

Execution plan 

Author: Jack Vamvas (http://www.sqlserver-dba.com)

Author: Jack Vamvas (http://www.sqlserver-dba.com)

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact