MikeShepardMikeShepard Posts: 12
edited June 20, 2005 11:01PM in SQL Backup Previous Versions
I want to be able to supply a TO DISK and a MIRRORFILE parameter, and have it succeed if either backup succeeds. The help file leads me to believe that this will work, but when I try it, it seems to return 0 (Failure) if either the TO DISK path or the MIRRORFILE path don't exist.

I am using the extended stored procedure. Here's an example command where the MIRRORFILE path doesn't exist, but the TO DISK does, and it still fails:

-SQL "BACKUP LOG [CRM88DMO] TO DISK = [\\mmofile\sqlbackups\MMOPSDEVAPP2\CRM88DMO\CRM88DMO_sqlbackup_2005-06-20_13.43.47.SQT] WITH NAME = [Database CRM88DMO, 2005-06-20_13.43.47], DESCRIPTION = [Backup on 2005-06-20_13.43.47 Database: CRM88DMO Server: MMOPSDEVAPP2], COMPRESSION=1,ERASEFILES_ATSTART
=3, MIRRORFILE= [ f:\sqlbackups2\CRM88DMO\CRM88DMO_sqlbackup_2005-06-20_13.43.47.SQT]" -E


  • peteypetey Posts: 2,358 New member
    The extended stored procedure returns a failure status if SQL Backup encounters any errors or warnings. In this case, a warning was raised because one of the mirror files failed to be created.

    An option may be to use the command line executable instead, and use the exit code value to check for warnings/errors, as warnings are in the range 1 to 499. Admittedly, this is a little cumbersome to work into a script.

    I've logged an issue to propose that future extended stored procedures return an output value that indicates the actual warning/error code.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
Sign In or Register to comment.