Skip to content

Commit 0319c3b

Browse files
authored
Merge pull request #2848 from PeteSral/dev
#2847 sp_BlitzCache: Fix negative CHARINDEX result when ) precedes ( in compile_time_value.
2 parents 55f1f3a + 1901057 commit 0319c3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sp_BlitzCache.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3982,7 +3982,7 @@ SET s.variable_datatype = CASE WHEN s.variable_datatype LIKE '%(%)%'
39823982
s.compile_time_value = CASE WHEN s.compile_time_value LIKE '%(%)%'
39833983
THEN SUBSTRING(s.compile_time_value,
39843984
CHARINDEX('(', s.compile_time_value) + 1,
3985-
CHARINDEX(')', s.compile_time_value) - 1 - CHARINDEX('(', s.compile_time_value)
3985+
CHARINDEX(')', s.compile_time_value, CHARINDEX('(', s.compile_time_value) + 1) - 1 - CHARINDEX('(', s.compile_time_value)
39863986
)
39873987
WHEN variable_datatype NOT IN ('bit', 'tinyint', 'smallint', 'int', 'bigint')
39883988
AND s.variable_datatype NOT LIKE '%binary%'

0 commit comments

Comments
 (0)