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 :
Clicking on the link , displays the Execution Plan.
Author: Jack Vamvas (http://www.sqlserver-dba.com)This is only a preview. Your comment has not yet been posted.
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.
Posted by: |