From 4a7299bbcc7ddd9789ef57cc8397525993158053 Mon Sep 17 00:00:00 2001 From: michele-tahay-kohera <62601152+michele-tahay-kohera@users.noreply.github.com> Date: Thu, 18 Jul 2024 19:49:16 +0200 Subject: [PATCH] small bugfix for systems with case sensitive collation I was getting the following results on a system with a case sensitive collation WARNING: [19:42:15][Test-DbaDbRecoveryModel] Error occurred while establishing connection to xxxxxxxxxx | The multi-part identifier "d.recovery_model" could not be bound. The multi-part identifier "d.name" could not be bound. The multi-part identifier "d.recovery_model" could not be bound. The multi-part identifier "d.recovery_model_desc" could not be bound. The multi-part identifier "d.recovery_model" could not be bound. --- public/Test-DbaDbRecoveryModel.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/Test-DbaDbRecoveryModel.ps1 b/public/Test-DbaDbRecoveryModel.ps1 index 9a83dafb5d..822b5cbbfe 100644 --- a/public/Test-DbaDbRecoveryModel.ps1 +++ b/public/Test-DbaDbRecoveryModel.ps1 @@ -98,9 +98,9 @@ function Test-DbaDbRecoveryModel { WHEN d.recovery_model = 1 AND drs.last_log_backup_lsn IS NOT NULL THEN 1 ELSE 0 END AS IsReallyInFullRecoveryModel - FROM sys.databases AS D + FROM sys.databases AS d INNER JOIN sys.database_recovery_status AS drs - ON D.database_id = drs.database_id + ON d.database_id = drs.database_id WHERE d.recovery_model = $recoveryCode" if ($Database) { @@ -152,4 +152,4 @@ function Test-DbaDbRecoveryModel { } } } -} \ No newline at end of file +}