[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 356
  • Last Modified:

How can I programmatically detect backup errors from SQL Server

I need a way to programmatically detect whether an error occured during a backup process.
I'm trying to avoid opening and parsing the SQL log files.
Any help will be highly appreciated.
Ephraim Wangoya
Ephraim Wangoya
2 Solutions
Guy Hengel [angelIII / a3]Billing EngineerCommented:
please see this document that describes the msdb table that contains the information:

Table name           Description
sysbackupdetail	The devices used to backup (dump).
sysbackuphistory	Summary of each backup operation (dump).
sysrestoredetail	The devices used to restore (load).
sysrestorehistory	Summary of each restore operation (load).
sysvolumelabel	Latest volume label values that were generated.

Open in new window

Aside from simply generating errors upon failed execution, you could do something like this:


there's a nice procedure suggestion in there from chapmandew, you can use this to poll the backup results automatically

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now