Skip to content

Commit

Permalink
Test-DbaDbCompatibility - Determining target compatibility level base…
Browse files Browse the repository at this point in the history
…d on server version (#8992)
  • Loading branch information
andreasjordan committed Jun 22, 2023
1 parent acc8bb3 commit e547035
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public/Test-DbaDbCompatibility.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ function Test-DbaDbCompatibility {
Stop-Function -Message "Failure" -Category ConnectionError -ErrorRecord $_ -Target $instance -Continue
}

$serverLevel = [Microsoft.SqlServer.Management.Smo.CompatibilityLevel]$server.Databases['master'].CompatibilityLevel
$serverVersion = $server.VersionMajor
$serverLevel = [Microsoft.SqlServer.Management.Smo.CompatibilityLevel]"Version$($serverVersion)0"
$dbs = $server.Databases

if ($Database) {
Expand Down

0 comments on commit e547035

Please sign in to comment.