LOGGING BACKUP FAILURES IN TABLES

  • I have scheduled a daily backup on some of the instances that use SQL Express.Is there a way I can log failed backup jobs in a table?We can use the backupset and backupfile tables in msdb to look up historical backup history of successful backups but is there a way to log failed backups?

    thanks in advance

  • One thing that you could do is to write a stored proc that does the back up. Check for error, If there is error, store it in a table that you created. So you have full control of what you are storing.

    I have not tested this solution, but our back up is done through stored proc where we pass parameters like what database needs to be backed up and which drive to back up. It also makes an entry in a table with the start time and end time of the back up. But we dont log the error.

    There might be other method that is much simpler, but this is what that comes into my mind.

    -Roy

  • There was an interesting article on this site this morning, I think it was a link to MSSQLTIPs that showed how to read the error log for failed logins...

    The link can be found here:

    http://www.mssqltips.com/tip.asp?tip=1750

    It wouldn't take much to re-work this tip to return failed backups instead.

    Thus recording failed backups to a table

    Gethyn Elliswww.gethynellis.com

  • Thank you guys for the info.GRE thank you for the link.I modified the code to pull failed backups.works like a charm.

  • [quote-0I have scheduled a daily backup on some of the instances that use SQL Express.[/quote-0]

    Can we schedule a backup in SQL Express..?

    Just asking..I had worked in express for a small project sometime backup. I was taking backups manualy that time.

  • Not sure that it is offered out the box so to speak...

    http://www.mssqltips.com/tip.asp?tip=1174

    but this other link from the same site explains how you can work around the problem

    Gethyn Elliswww.gethynellis.com

  • San,

    I created a stored proc which is being called by an osql script.I then schedule this osql scrip to run every night using windows scheduler.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply