Find which db have not been backuped

This is a script I run periodically to identify databases with no backup.
I’ve been running this just in case a database is created out of left field or maybe was omitted from a backup job.




use msdb
go
select distinct
d.name
from sys.databases d
left join backupset bs
on bs.database_name = d.name
where bs.database_name is null
and d.name <> 'tempdb'
order by d.name

Comments

Popular posts from this blog

Index Clean-Up Scripts

forgot sa password and no logins are added

The SQL Server DBA’s Guide to Teradata