Comfirming param for failure email on a restore job

egayegay Posts: 5
edited October 25, 2007 12:56PM in SQL Backup Previous Versions
I know you have to manually edit the restore job -- what's the param to use for an email on failture during a restore? Is the the same as the backup? (MAILTO_ONERROR)

The restore job is --

DECLARE @errorCode INT
DECLARE @sqlerrorCode INT
EXECUTE master..sqlbackup N'-SQL "RESTORE LOG [WillowQC1] FROM DISK = ''\\wh_reporting\incoming\LOG_WillowQC1_*.sqb'' WITH ERASEFILES = 168h, STANDBY = ''e:\2005-data\MSSQL$SQL2005\Backup\UNDO_WillowQC1.dat'', MOVETO = ''E:\2005-data\MSSQL$SQL2005\TRN_LOG_APPLIED''"', @errorCode OUT, @sqlerrorCode OUT;
IF (@errorCode >= 500) OR (@sqlerrorCode <> 0)
BEGIN
RAISERROR ('SQL Backup failed with exit code: %d SQL error code: %d', 16, 1, @errorCode, @sqlerrorcode)
END

Comments

Sign In or Register to comment.