Home Forums SQL Server 2008 T-SQL (SS2K8) Getting NULL output against the column : completion_status RE: Getting NULL output against the column : completion_status

  • Hi Sourav,

    Glad that lyou are making progress towards your goal.

    I don't have SQL Server open in front of me, so these comments are just observations, maybe correct, maybe not.

    It looks like you are measuring success if the latest backup time is within one hour of the current time. Is this what you want, and does it hold for all types of backups (full, diff, log)?

    Also, the query looks for backup types where the max(backup_finish_date) is null and that condition is called "No data". That would mean that no backup had ever been completed for that database (and type). Since that condition is fairly unusual (in my experience), you may want to add additional code to your solution that defines a failed backup event as conditional based on the type of backup and the length of time between the current time and the last backup of that type (e.g. >24 hours means failed full backup; >1 hour means failed diff backup, etc)

    I think you are going in this direction, but perhaps you didn't post your full code.

    HTH,

    Elliott