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
2814
-
SUBSTRING(
2819
+
SET Warnings =SUBSTRING(
2815
2820
CASEWHEN warning_no_join_predicate =1THEN', No Join Predicate'ELSE''END+
@@ -2862,9 +2867,8 @@ SET Warnings = CASE WHEN QueryPlan IS NULL THEN 'We couldn''t find a plan for
2862
2867
CASEWHEN index_dml =1THEN', Index DML'ELSE''END+
2863
2868
CASEWHEN table_dml =1THEN', Table DML'ELSE''END+
2864
2869
CASEWHEN low_cost_high_cpu =1THEN', Low Cost High CPU'ELSE''END+
2865
-
CASEWHEN long_running_low_cpu =1THEN+'Long Running With Low CPU'ELSE''END
2870
+
CASEWHEN long_running_low_cpu =1THEN+', Long Running With Low CPU'ELSE''END
2866
2871
, 2, 200000)
2867
-
END
2868
2872
WHERE SPID =@@SPID
2869
2873
OPTION (RECOMPILE) ;
2870
2874
@@ -2874,8 +2878,7 @@ WITH statement_warnings AS
2874
2878
(
2875
2879
SELECT DISTINCT
2876
2880
SqlHandle,
2877
-
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
2878
-
SUBSTRING(
2881
+
Warnings =SUBSTRING(
2879
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