Backup Question
qsac226
Posts: 22
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"'
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"'
Comments
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
Head of DBA Tools
Red Gate Software Ltd
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.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8