You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sp_BlitzBackups: use @starttime for CheckId 7 and 12
The "No CHECKSUMS" (CheckId 7) and "Uncompressed backups" (CheckId 12)
checks were filtering on a hard-coded 30-day window via
DATEADD(DAY, -30, SYSDATETIME()) instead of the user-supplied
@HoursBack window already exposed via @starttime. That ignored
@HoursBack and made the warning text inconsistent with the actual
window being analyzed.
Replace both filters with @starttime, pass @starttime through
sp_executesql, and drop the "in the last 30 days" / "in the past 30
days" wording from the findings now that the window is dynamic. Same
treatment as PR BrentOzarULTD#3960 applied to CheckId 14.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
''The database '' + QUOTENAME(b.database_name) + '' has been backed up '' + CONVERT(VARCHAR(10), COUNT(*)) + '' times without CHECKSUMS in the past 30 days. CHECKSUMS can help alert you to corruption errors.'' AS [Warning]
978
+
''The database '' + QUOTENAME(b.database_name) + '' has been backed up '' + CONVERT(VARCHAR(10), COUNT(*)) + '' times without CHECKSUMS. CHECKSUMS can help alert you to corruption errors.'' AS [Warning]
979
979
FROM '+QUOTENAME(@MSDBName) + N'.dbo.backupset AS b
980
980
WHERE b.has_backup_checksums = 0
981
-
AND b.backup_finish_date >= DATEADD(DAY, -30, SYSDATETIME())
/*Damaged is a Black Flag album. You don''t want your backups to be like a Black Flag album. */
991
991
992
992
SET @StringToExecute =N'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;'+ @crlf;
@@ -1089,17 +1089,17 @@ IF @ProductVersionMajor >= 12
1089
1089
100 AS [Priority],
1090
1090
b.database_name AS [Database Name],
1091
1091
''Uncompressed backups'' AS [Finding],
1092
-
''The database '' + QUOTENAME(b.database_name) + '' has had '' + CONVERT(VARCHAR(10), COUNT(*)) + '' uncompressed backups in the last 30 days. This is a free way to save time and space. And SPACETIME. If your version of SQL supports it.'' AS [Warning]
1092
+
''The database '' + QUOTENAME(b.database_name) + '' has had '' + CONVERT(VARCHAR(10), COUNT(*)) + '' uncompressed backups. This is a free way to save time and space. And SPACETIME. If your version of SQL supports it.'' AS [Warning]
1093
1093
FROM '+QUOTENAME(@MSDBName) +'.dbo.backupset AS b
1094
1094
WHERE backup_size = compressed_backup_size AND type = ''D''
1095
-
AND b.backup_finish_date >= DATEADD(DAY, -30, SYSDATETIME())
0 commit comments