I am whipping up my own script for backups (diff, full and log) with emailing, compression and deletion of files X days long etc (I will post when complete).
I am having problems trapping the BACKUP command on failure... ie:
set @v_starttime = getdate()
BACKUP DATABASE @p_database TO vxtmpdump WITH INIT, NAME = @p_database, NOSKIP , STATS = 10, DESCRIPTION = @v_filename, NOFORMAT
if @@error > 0 then
does not work, actually the script stops immediatly at the failure of the command. Is the only way to trap this error is by scheduling it as a job?
Author of "SQL Server Backup, Recovery & Troubleshooting"
Author of "SQL Server 2k for the Oracle DBA"