Install-DbaFirstResponderKit - Use the declared variable name when cloning the certificate to master - #10669
Open
andreasjordan wants to merge 1 commit into
Open
Conversation
…oning the certificate to master The certificate-cloning batch declares @SQL but executes EXEC(@SQL). On a case-sensitive instance the server rejects that with "Must declare the scalar variable @SQL", so signing fails and PublicExecute never grants public the permissions it promised. (do Install-DbaFirstResponderKit)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On a case-sensitive instance,
Install-DbaFirstResponderKit -PublicExecuteinto a user database warnsCertificate signing failed ... Must declare the scalar variable "@SQL", and public never gets the promised EXECUTE permissions.Mechanism
The batch that clones the signing certificate into master declares
@sqland then runsEXEC(@SQL). Variable names follow the instance collation, so a case-sensitive server does not know@SQL. Case-insensitive instances - which is what CI has - never notice.What changed
EXEC(@sql). One character. A scan over every@variableinpublic/andprivate/for names that appear in more than one casing within one file found no other site.Tests
SQL_Latin1_General_CP1_CS_AS): red on the old code exactly as reported above, green with the fix. FullInstall-DbaFirstResponderKit.Tests.ps1green through the testing-dbatools harness.created by Claude and reviewed by Andreas Jordan
🤖 Generated with Claude Code