Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inserted columns are incorrect (probably just swapped) in a couple of places #3514

Closed
garyhuntddn opened this issue May 6, 2024 · 1 comment

Comments

@garyhuntddn
Copy link
Contributor

garyhuntddn commented May 6, 2024

Version of the script
dev branch

What is the current behavior?
minor mistakes in the code - see the insert statements around the max number of databases

INSERT    #BlitzIndexResults ( Priority, check_id, findings_group, finding, URL, details, index_definition,
                                            index_usage_summary, index_size_summary )
 VALUES  ( 
-1, -- ends up in the Priority column
0 , -- ends up in the check_id column
@ScriptVersionName, -- ends up in the findings_group column
CASE WHEN @GetAllDatabases = 1 THEN N'All Databases' ELSE N'Database ' + QUOTENAME(@DatabaseName) + N' as of ' + CONVERT(NVARCHAR(16), GETDATE(), 121) END, -- ends up in the finding column
N'From Your Community Volunteers',   -- ends up in the URL column - surely this is wrong?
N'http://FirstResponderKit.org', -- ends up in the details column - surely this is wrong?
N'', -- ends up in the index_definition column
N'', -- ends up in the index_usage_summary column
N'' -- ends up in the index_size_summary column
)

Same with the other query fixed in #3512

If the current behavior is a bug, please provide the steps to reproduce.
run with a large number of databases - the URL ends up in the wrong column

What is the expected behavior?
that the correct columns are inserted into

Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures?
not specific to a version of SQL server (but I happen to be on Windows and Linux with v2022)

@garyhuntddn garyhuntddn changed the title Minor fixes Inserted columns are incorrect (probably just swapped) in a couple of places May 6, 2024
@BrentOzar
Copy link
Member

Thanks for the pull request! Looks good, merging into the dev branch, will be in the next release with credit to you in the release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants