added files from swmgmt03

This commit is contained in:
Schork Thierry (Galenica - ADM)
2025-09-22 09:00:00 +02:00
parent de97031b1e
commit 63d058a7eb
67 changed files with 13300 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
USE master; -- Ensure you are connected to the master database
GO
-- Retrieve the last full backup date for the specified database
SELECT top 10
b.backup_start_date AS BackupDate,
CASE
WHEN b.type = 'D' THEN 'Full'
WHEN b.type = 'L' THEN 'Log'
ELSE 'Other'
END AS BackupType
FROM msdb.dbo.backupset b
INNER JOIN (
SELECT
database_name,
MAX(backup_start_date) AS last_backup_date
FROM msdb.dbo.backupset
WHERE database_name = 'arizona'
GROUP BY database_name
) maxb ON b.database_name = maxb.database_name
--AND b.backup_start_date = maxb.last_backup_date
and b.type = 'D'
order by backup_finish_date desc