我想查找从未备份的数据库列表,我有代码列出所有数据库的上次备份时间:
SELECT
sdb.Name AS DatabaseName
, COALESCE(CONVERT(VARCHAR(12), MAX(bus.backup_finish_date), 101), '-') AS LastBackUpTime
FROM sys.sysdatabases sdb
LEFT OUTER JOIN msdb.dbo.backupset bus ON bus.database_name = sdb.Name
GROUP BY sdb.Name