Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7a9bbef

Browse files
Merge pull request dataplat#3881 from andrekamman/development
Fixed support for SQL Server 2016 SP2 & Azure SQL Database in DiagnosticQueries
2 parents 42fe971 + 8af087e commit 7a9bbef

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

‎functions/Get-DbaDatabase.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ function Get-DbaDatabase {
289289
$_.IsAccessible -in $AccessibleFilter -and
290290
$_.IsSystemObject -in $DBType -and
291291
((Compare-Object @($_.Status.tostring().split(',').trim()) $Status -ExcludeDifferent -IncludeEqual).inputobject.count -ge 1 -or !$status) -and
292-
$_.RecoveryModel -in $RecoveryModel -and
292+
($_.RecoveryModel -in $RecoveryModel-or!$_.RecoveryModel) -and
293293
$_.EncryptionEnabled -in $Encrypt
294294
}
295295
if ($NoFullBackup -or $NoFullBackupSince) {

‎functions/Invoke-DbaDiagnosticQuery.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,14 @@ function Invoke-DbaDiagnosticQuery {
250250
}
251251
}
252252

253+
if ($version -eq "2016" -and $server.VersionMinor -gt 5026 ) {
254+
$version = "2016SP2"
255+
}
256+
257+
if ($server.DatabaseEngineType -eq "SqlAzureDatabase") {
258+
$version = "AzureSQLDatabase"
259+
}
260+
253261
if (!$instanceOnly) {
254262
if (-not $Database) {
255263
$databases = (Get-DbaDatabase -SqlInstance $server -ExcludeAllSystemDb -ExcludeDatabase $ExcludeDatabase).Name

‎internal/functions/Invoke-DbaDiagnosticQueryScriptParser.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
foreach ($line in $fullscript) {
2929
if ($start -eq $false) {
30-
if ($line -match "You have the correct major version of SQL Server for this diagnostic information script") {
30+
if (($line -match "You have the correct major version of SQL Server for this diagnostic information script") -or ($line.StartsWith("-- Server level queries ***"))) {
3131
$start = $true
3232
}
3333
continue

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /