Skip to content

Commit

Permalink
Fix Issue olahallengren#337 Error when LOG_SIZE_SINCE_LAST_LOG_BACKUP…
Browse files Browse the repository at this point in the history
…_* is specified

olahallengren#337
  • Loading branch information
Rob-S authored Jan 22, 2020
1 parent 1ebeba2 commit 079699f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DatabaseBackup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2176,7 +2176,7 @@ BEGIN
SELECT 'The value for the parameter @DatabaseOrder is not supported.', 16, 1
END

IF @DatabaseOrder IN('LOG_SIZE_SINCE_LAST_LOG_BACKUP_ASC','LOG_SIZE_SINCE_LAST_LOG_BACKUP_DESC') AND EXISTS(SELECT * FROM sys.all_columns WHERE object_id = OBJECT_ID('sys.dm_db_log_stats') AND name = 'log_since_last_log_backup_mb')
IF @DatabaseOrder IN('LOG_SIZE_SINCE_LAST_LOG_BACKUP_ASC','LOG_SIZE_SINCE_LAST_LOG_BACKUP_DESC') AND NOT EXISTS(SELECT * FROM sys.all_columns WHERE object_id = OBJECT_ID('sys.dm_db_log_stats') AND name = 'log_since_last_log_backup_mb')
BEGIN
INSERT INTO @Errors ([Message], Severity, [State])
SELECT 'The value for the parameter @DatabaseOrder is not supported. The column sys.dm_db_log_stats.log_since_last_log_backup_mb is not available in this version of SQL Server.', 16, 2
Expand Down

0 comments on commit 079699f

Please sign in to comment.