Issues with creating jobs in Enterprise Manager
webgs
Posts: 2
I've created a job to run a differential backup on a database. I've used the TSQL script generated by SQL Backup. Here's the resulting script:
master..sqlbackup '-SQL "BACKUP DATABASE [DBMon] TO DISK = ''F:\SQLDump\SQLBackup\DIFF_MNFOODS_DBMon_<DATETIME yyyymmdd hhnnss>.sqb'' WITH NAME = ''Database (DBMon), 7/20/2005 10:36:39 AM'', DESCRIPTION = ''Backup on 7/20/2005 10:36:39 AM Database: DBMon Instance: MNFOODS Server: SERVER'', DIFFERENTIAL, COMPRESSION = 1" -E -I MNFOODS'
Here's the error it produces when testing with query analyzer:
Output from SQL Backup (3.2.0)
SQL Backup 3.2.0, (c) Red Gate Software Ltd 2004 - 2005
Trial - 7 days remaining
Backing up DBMon (differential database) on MNFOODS instance to F:\SQLDump\SQLBackup\DIFF_MNFOODS_DBMon_<DATETIME yyyymmdd hhnns
Thread 0 error:
Error 605: Error creating backup file(s). No files could be created.
Thread 0 warning:
Warning 600: Error creating backup file: F:\SQLDump\SQLBackup\DIFF_MNFOODS_DBMon_<DATETIME yyyymmdd hhnnss>.sqb.
Warning: System error code: (The filename, directory name, or volume label syntax is incorrect)
Msg 3013, Level 16, State 1, Server SERVER\MNFOODS, Line 1
BACKUP DATABASE is terminating abnormally.
(10 row(s) affected)
I need to populate the "<DATETIME yyyymmdd hhnnss>" portion of the file name so it works with SQL. I would also like to populate the current date in the "Name" and "Description" areas of the script.
Any help would be appreciated.
Thank you!
master..sqlbackup '-SQL "BACKUP DATABASE [DBMon] TO DISK = ''F:\SQLDump\SQLBackup\DIFF_MNFOODS_DBMon_<DATETIME yyyymmdd hhnnss>.sqb'' WITH NAME = ''Database (DBMon), 7/20/2005 10:36:39 AM'', DESCRIPTION = ''Backup on 7/20/2005 10:36:39 AM Database: DBMon Instance: MNFOODS Server: SERVER'', DIFFERENTIAL, COMPRESSION = 1" -E -I MNFOODS'
Here's the error it produces when testing with query analyzer:
Output from SQL Backup (3.2.0)
SQL Backup 3.2.0, (c) Red Gate Software Ltd 2004 - 2005
Trial - 7 days remaining
Backing up DBMon (differential database) on MNFOODS instance to F:\SQLDump\SQLBackup\DIFF_MNFOODS_DBMon_<DATETIME yyyymmdd hhnns
Thread 0 error:
Error 605: Error creating backup file(s). No files could be created.
Thread 0 warning:
Warning 600: Error creating backup file: F:\SQLDump\SQLBackup\DIFF_MNFOODS_DBMon_<DATETIME yyyymmdd hhnnss>.sqb.
Warning: System error code: (The filename, directory name, or volume label syntax is incorrect)
Msg 3013, Level 16, State 1, Server SERVER\MNFOODS, Line 1
BACKUP DATABASE is terminating abnormally.
(10 row(s) affected)
I need to populate the "<DATETIME yyyymmdd hhnnss>" portion of the file name so it works with SQL. I would also like to populate the current date in the "Name" and "Description" areas of the script.
Any help would be appreciated.
Thank you!
Comments
In your example, you could define your 'Backup folder' as 'F:\SQLDump\SQLBackup' and your file name format as '<TYPE>_<SERVER>_<DATABASE>_<DATETIME yyyymmdd hhnnss>.sqb'.
Presently, SQL Backup does not replace tags for the 'Name' and 'Description' values.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8