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

Correction - wrong error handling removed during SQL line insertion command #3665

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions Misc/Set-BcContainerFeatureKeys.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,10 @@ try {
$SQLRecord = Invoke-Sqlcmd -Database $databaseName -Query "SELECT * FROM [dbo].[Tenant Feature Key] where ID = '$featureKey'"
if ([String]::IsNullOrEmpty($SQLRecord))
{
Write-host -NoNewline "Creating record for feature ID '$featureKey' - "
Write-host "Creating record for feature ID '$featureKey'"
$SQLcolumns = "ID, Enabled"
$SQLvalues = "'$featureKey',0"
Invoke-Sqlcmd -Database $databaseName -Query "INSERT INTO [CRONUS].[dbo].[Tenant Feature Key]($SQLcolumns) VALUES ($SQLvalues)"
if ($result[0] -eq "1") {
Write-Host " Created"
}
Invoke-Sqlcmd -Database $databaseName -Query "INSERT INTO [CRONUS].[dbo].[Tenant Feature Key] ($SQLcolumns) VALUES ($SQLvalues)" -Verbose
}
Write-Host -NoNewline "Setting feature key $featureKey to $enabledStr - "
$result = Invoke-Sqlcmd -Database $databaseName -Query "UPDATE [dbo].[Tenant Feature Key] set Enabled = $enabled where ID = '$featureKey';Select @@ROWCOUNT"
Expand Down