July 8, 2001 at 11:43 am
Hi all
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
<etc>
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?
Cheers
Chris
Chris Kempster
www.chriskempster.com
Author of "SQL Server Backup, Recovery & Troubleshooting"
Author of "SQL Server 2k for the Oracle DBA"
July 8, 2001 at 11:04 pm
You might try trapping using DTS. Enter this command in a T-SQL step and then setting succes and failure steps.
Steve Jones
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy