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 =CASEWHEN QueryPlan ISNULLTHEN'We couldn''t find a plan for this query. Possible reasons for this include dynamic SQL, RECOMPILE hints, and encrypted code.'ELSE
2820
-
SUBSTRING(
2819
+
SET Warnings =SUBSTRING(
2821
2820
CASEWHEN warning_no_join_predicate =1THEN', No Join Predicate'ELSE''END+
@@ -2870,7 +2869,6 @@ SET Warnings = CASE WHEN QueryPlan IS NULL THEN 'We couldn''t find a plan for
2870
2869
CASEWHEN low_cost_high_cpu =1THEN', Low Cost High CPU'ELSE''END+
2871
2870
CASEWHEN long_running_low_cpu =1THEN+'Long Running With Low CPU'ELSE''END
2872
2871
, 2, 200000)
2873
-
END
2874
2872
WHERE SPID =@@SPID
2875
2873
OPTION (RECOMPILE) ;
2876
2874
@@ -2880,8 +2878,7 @@ WITH statement_warnings AS
2880
2878
(
2881
2879
SELECT DISTINCT
2882
2880
SqlHandle,
2883
-
Warnings =CASEWHEN QueryPlan ISNULLTHEN'We couldn''t find a plan for this query. Possible reasons for this include dynamic SQL, RECOMPILE hints, and encrypted code.'ELSE
2884
-
SUBSTRING(
2881
+
Warnings =SUBSTRING(
2885
2882
CASEWHEN warning_no_join_predicate =1THEN', No Join Predicate'ELSE''END+
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'
2959
+
, 'We couldn''t find a plan for this query. Possible reasons for this include dynamic SQL, RECOMPILE hints, and encrypted code.')
2960
+
FROM ##bou_BlitzCacheProcs b
2961
+
LEFT JOIN plan_handle ph ON
2962
+
b.PlanHandle=ph.PlanHandle
2963
+
WHEREb.QueryPlanISNULL
2964
+
ANDb.SPID=@@SPID
2965
+
OPTION (RECOMPILE);
2966
+
2967
+
RAISERROR('Checking for plans with no warnings', 0, 1) WITHNOWAIT;
0 commit comments