You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SET Warnings =ISNULL('Your query plan is >128 levels of nested nodes, and can''t be converted to XML. Use SELECT * FROM sys.dm_exec_text_query_plan('+CONVERT(VARCHAR(128), ph.PlanHandle, 1) +', 0, -1) to get more information'
5156
-
, 'We couldn''t find a plan for this query. More info on possible reasons: https://www.brentozar.com/go/noplans')
5157
-
FROM ##BlitzCacheProcs b
5158
-
LEFT JOIN plan_handle ph ON
5159
-
b.PlanHandle=ph.PlanHandle
5143
+
/* Populate oversized plans as processing instructions so they're clickable in SSMS */
5144
+
RAISERROR('Checking for plans with >128 levels of nesting', 0, 1) WITHNOWAIT;
5145
+
UPDATE
5146
+
b
5147
+
SET
5148
+
b.QueryPlan=
5149
+
(
5150
+
SELECT
5151
+
[processing-instruction(query_plan)] =
5152
+
N'-- '+NCHAR(13) +NCHAR(10) +
5153
+
N'-- This is a huge query plan.'+NCHAR(13) +NCHAR(10) +
5154
+
N'-- Remove the headers and footers, save it as a .sqlplan file, and re-open it.'+NCHAR(13) +NCHAR(10) +
b.Warnings='This is a huge query plan (>128 levels of nesting). Click the plan link, remove the headers and footers, and save it as a .sqlplan file to view it.'
5164
+
FROM ##BlitzCacheProcs AS b
5165
+
CROSSAPPLYsys.dm_exec_text_query_plan(b.PlanHandle, COALESCE(b.StatementStartOffset, 0), COALESCE(b.StatementEndOffset, -1)) AS tqp
5166
+
CROSSAPPLYsys.dm_exec_query_plan(b.PlanHandle) AS qp
0 commit comments