Quantcast
Channel: Red Gate forums: SQL Backup 7
Viewing all articles
Browse latest Browse all 713

RE: Email when restore process fails

$
0
0
Use the MAILTO_ONERROR option e.g.

Code:
EXEC master..sqlbackup '-sql "RESTORE DATABASE ... WITH MAILTO_ONERROR = [dba@myco.com]"'

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.

Code:
EXEC master..sqlbackup '-sql "BACKUP DATABASE model TO DISK = [<AUTO>] WITH MAILTO = [dba@myco.com]"'

Viewing all articles
Browse latest Browse all 713

Trending Articles