DECLARE @exitcode int DECLARE @sqlerrorcode int EXEC master..sqlbackup '-sql "BACKUP ..."', @exitcode OUTPUT, @sqlerrorcode OUTPUT IF (@exitcode <> 0) OR (@sqlerrorcode <> 0) BEGIN RAISERROR ('SQL Backup step failed: exit code %d, SQL error code: %d', 16, 1, @exitcode, @sqlerrorcode) END
Tips and how-to guides for Redgate products
Ask, discuss, and solve questions about Redgate's tools
Meet us at an event, get sponsored, and join our Friends of Redgate
In-depth articles and opinion from Redgate's technical journal
Comments
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
Just what I needed!