Commit dc10aef
sp_BlitzFirst CheckID 49: fix XPath and missing line break in Details output
Two fixes based on Copilot review feedback on PR BrentOzarULTD#3921:
* Switch .value('text()[1]', 'nvarchar(max)') to .value(N'.[1]', N'NVARCHAR(MAX)')
on all three Top-5 STUFF/FOR XML blocks. text()[1] returns only the first
text node; when a program_name contains <, >, or & it gets entity-escaped
and breaks the concatenation into multiple text nodes, so only the first
row would appear. The new form matches the existing pattern used elsewhere
in sp_BlitzFirst (see line 2487).
* Insert @linefeed between each "Top 5 X:" header and the first row. The
Top-5 strings are built with STUFF(..., 1, LEN(@linefeed), N'') so they
don't start with a line break, which was running the first entry onto
the header line.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent cd914b7 commit dc10aef
1 file changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2732 | 2732 | | |
2733 | 2733 | | |
2734 | 2734 | | |
2735 | | - | |
| 2735 | + | |
2736 | 2736 | | |
2737 | 2737 | | |
2738 | 2738 | | |
| |||
2769 | 2769 | | |
2770 | 2770 | | |
2771 | 2771 | | |
2772 | | - | |
| 2772 | + | |
2773 | 2773 | | |
2774 | 2774 | | |
2775 | 2775 | | |
| |||
2806 | 2806 | | |
2807 | 2807 | | |
2808 | 2808 | | |
2809 | | - | |
| 2809 | + | |
2810 | 2810 | | |
2811 | 2811 | | |
2812 | 2812 | | |
| |||
2818 | 2818 | | |
2819 | 2819 | | |
2820 | 2820 | | |
2821 | | - | |
2822 | | - | |
2823 | | - | |
| 2821 | + | |
| 2822 | + | |
| 2823 | + | |
2824 | 2824 | | |
2825 | 2825 | | |
2826 | 2826 | | |
| |||
0 commit comments