Skip to content

Commit ec47ee0

Browse files
committed
Add version check warnings rollup
Need this to avoid not exists error on @v < 11
1 parent 8889090 commit ec47ee0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sp_BlitzCache.sql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4081,7 +4081,9 @@ BEGIN
40814081
'A high number of plan stubs may result in CMEMTHREAD waits, which you have '
40824082
+ CONVERT(VARCHAR(10), (SELECT CONVERT(DECIMAL(9,0), (dows.wait_time_ms / 60000.)) FROM sys.dm_os_wait_stats AS dows WHERE dows.wait_type = 'CMEMTHREAD')) + ' minutes of.'
40834083
FROM #plan_stubs_warning p ;
4084-
4084+
4085+
IF @v >= 11
4086+
BEGIN
40854087
IF EXISTS (SELECT 1/0
40864088
FROM #trace_flags AS tf
40874089
WHERE tf.global_trace_flags IS NOT NULL
@@ -4094,6 +4096,7 @@ BEGIN
40944096
'You have Global Trace Flags enabled on your server',
40954097
'https://www.brentozar.com/blitz/trace-flags-enabled-globally/',
40964098
'You have the following Global Trace Flags enabled: ' + (SELECT TOP 1 tf.global_trace_flags FROM #trace_flags AS tf WHERE tf.global_trace_flags IS NOT NULL)) ;
4099+
END
40974100

40984101
IF NOT EXISTS (SELECT 1/0
40994102
FROM ##bou_BlitzCacheResults AS bcr

0 commit comments

Comments
 (0)