When i run the script below in Query Analyzer, it returns the results.

If i run the script below in a Job, is there anyway to record to output? Does it already write teh resutls to a table?

master..sqlbackup N'-SQL "BACKUP DATABASES [*]
TO DISK = ''E:\MSSQL\Backups\<AUTO>''
WITH NAME = ''<AUTO>'',
DESCRIPTION = ''<AUTO>'',
VERIFY,
ERASEFILES_ATSTART = 20h,
COMPRESSION = 3"'
qsac226
0

Comments

2 comments

  • James Moore
    Hi there,

    master..sqlbackup takes two out parameters @errorCode and @sqlErrorCode which will return any warning or error codes SQL Backup has (@errorCode) or any SQL Server errors (@sqlErrorCode). These codes are documented in the help file.

    - James
    James Moore
    0
  • petey
    The output is stored in a log file. The default folder is <system drive>\Documents and Settings\All Users\Application Data\Red Gate\SQL Backup\Log\<instance name>. You can store additional copies in a folder of your choice by using the LOGTO option e.g.
    master..sqlbackup N'-SQL "BACKUP DATABASES &#91;*&#93; 
    TO DISK = ''E:\MSSQL\Backups\&lt;AUTO&gt;'' 
    WITH NAME = ''&lt;AUTO&gt;'', 
    DESCRIPTION = ''&lt;AUTO&gt;'', 
    VERIFY, 
    ERASEFILES_ATSTART = 20h, 
    COMPRESSION = 3, LOGTO = &#91;E:\Logs&#93;"'
    
    In this case, SQL Backup will store an additional copy of the log file in the E:\Logs folder.

    You can also retrieve the backup/restore statistics from the standard SQL Server backup tables. See http://www.red-gate.com/messageboard/viewtopic.php?t=2241 for details.
    petey
    0

Add comment

Please sign in to leave a comment.