Find Databse Names on which FULL BACKUP got failed on a particular day.

I got a scenario where my manager askeed me to find out databse names on which 
FULL BACKUP got failed on a particular days. Date and Times are mentioned below. Every week 
full backups on sunday at 10:00PM
/*
Finding out database name which are not happening on
a particular day and time, in my scenario FULL backups are happeniNG
at 10:00PM
*/
SELECT DISTINCT DATABASE_NAME+', '
FROM msdb.dbo.backupset
WHERE DATABASE_NAME NOT IN(
SELECT DATABASE_NAME
FROM msdb.dbo.backupset
where year(backup_start_date)=2020
and month(backup_start_date)=5
and day(backup_start_date)in (29,30)
and type='D'
AND CONVERT(VARCHAR(10), CAST(getdate() AS TIME), 0)>'10:00PM')


Comments

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Pre login Handshake or Connection Timeout Period

Transparent Data Encryption(TDE) with Master Key and Certificate in SQL Server