Email when restore process fails

db3712db3712 Posts: 2
edited May 5, 2014 11:19PM in SQL Backup Previous Versions
Hello. We utilize a web-based application that requires us to pull data down locally for reporting purposes. We have a restore process setup hourly. Is there an option to email an individual when the restore process fails? Thanks!

Comments

  • peteypetey Posts: 2,358 New member
    Use the MAILTO_ONERROR option e.g.
    EXEC master..sqlbackup '-sql "RESTORE DATABASE ... WITH MAILTO_ONERROR = [[email protected]]"'
    
    You will need to first set up your email server settings in the GUI. Then run a test, from within the GUI, and from an extended stored procedure e.g.
    EXEC master..sqlbackup '-sql "BACKUP DATABASE model TO DISK = [<AUTO>] WITH MAILTO = [[email protected]]"'
    
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
Sign In or Register to comment.