Comments
2 comments
-
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 -
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 [*] TO DISK = ''E:\MSSQL\Backups\<AUTO>'' WITH NAME = ''<AUTO>'', DESCRIPTION = ''<AUTO>'', VERIFY, ERASEFILES_ATSTART = 20h, COMPRESSION = 3, LOGTO = [E:\Logs]"'
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.
Add comment
Please sign in to leave a comment.
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"'