@@ -20,7 +20,6 @@ ALTER PROCEDURE dbo.sp_AllNightLog
2020 @Restore BIT = 0 ,
2121 @Debug BIT = 0 ,
2222 @Help BIT = 0 ,
23- @ChangeBackupType NVARCHAR(MAX)= ' Y' ,
2423 @VersionDate DATETIME = NULL OUTPUT
2524WITH RECOMPILE
2625AS
@@ -115,6 +114,7 @@ DECLARE @msg NVARCHAR(4000) = N''; --Used for RAISERROR
115114DECLARE @rpo INT ; -- Used to hold the RPO value in our configuration table
116115DECLARE @rto INT ; -- Used to hold the RPO value in our configuration table
117116DECLARE @backup_path NVARCHAR(MAX); -- Used to hold the backup path in our configuration table
117+ DECLARE @changebackuptype NVARCHAR(MAX); -- Config table: Y = escalate to full backup, MSDB = escalate if MSDB history doesn't show a recent full.
118118DECLARE @encrypt NVARCHAR(MAX); -- Config table: Y = encrypt the backup. N (default) = do not encrypt.
119119DECLARE @encryptionalgorithm NVARCHAR(MAX); -- Config table: native 2014 choices include TRIPLE_DES_3KEY, AES_128, AES_192, AES_256
120120DECLARE @servercertificate NVARCHAR(MAX); -- Config table: server certificate that is used to encrypt the backup
@@ -705,6 +705,11 @@ LogShamer:
705705 RETURN;
706706 END;
707707
708+ SELECT @changebackuptype = configuration_setting
709+ FROM msdbCentral .dbo .backup_configuration c
710+ WHERE configuration_name = N' change backup type'
711+ AND database_name = N' all' ;
712+
708713 SELECT @encrypt = configuration_setting
709714 FROM msdbCentral .dbo .backup_configuration c
710715 WHERE configuration_name = N' encrypt'
@@ -883,7 +888,7 @@ LogShamer:
883888 @BackupType = ' LOG' , -- Going for the LOGs
884889 @Directory = @backup_path, -- The path we need to back up to
885890 @Verify = ' N' , -- We don't want to verify these, it eats into job time
886- @ChangeBackupType = @ChangeBackupType , -- If we need to switch to a FULL because one hasn't been taken
891+ @ChangeBackupType = @changebackuptype , -- If we need to switch to a FULL because one hasn't been taken
887892 @CheckSum = ' Y' , -- These are a good idea
888893 @Compress = ' Y' , -- This is usually a good idea
889894 @LogToTable = ' Y' , -- We should do this for posterity
@@ -896,7 +901,7 @@ LogShamer:
896901 @BackupType = ' LOG' , -- Going for the LOGs
897902 @Directory = @backup_path, -- The path we need to back up to
898903 @Verify = ' N' , -- We don't want to verify these, it eats into job time
899- @ChangeBackupType = @ChangeBackupType , -- If we need to switch to a FULL because one hasn't been taken
904+ @ChangeBackupType = @changebackuptype , -- If we need to switch to a FULL because one hasn't been taken
900905 @CheckSum = ' Y' , -- These are a good idea
901906 @Compress = ' Y' , -- This is usually a good idea
902907 @LogToTable = ' Y' ; -- We should do this for posterity
0 commit comments