Skip to content

Commit 8a1b8bf

Browse files
BrentOzarclaude
andcommitted
Fix deadlock_group query numbering label for 0-based qn
The CASE expression mapped qn=0 to "Query #1" but then used qn directly for all other values, so qn=1 also displayed as "Query #1". Replace the CASE with a simple qn + 1 conversion so labels are always correct (qn=0 → "Query #1", qn=1 → "Query #2", etc). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3e0c5aa commit 8a1b8bf

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

sp_BlitzLock.sql

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3765,11 +3765,8 @@ BEGIN
37653765
d.en
37663766
) +
37673767
N', Query #'
3768-
+ CASE
3769-
WHEN d.qn = 0
3770-
THEN N'1'
3771-
ELSE CONVERT(nvarchar(10), d.qn)
3772-
END + CASE
3768+
+ CONVERT(nvarchar(10), d.qn + 1)
3769+
+ CASE
37733770
WHEN d.is_victim = 1
37743771
THEN N' - VICTIM'
37753772
ELSE N''

0 commit comments

Comments
 (0)