Issues with creating jobs in Enterprise Manager
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.