![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 3 of 3 total |
![]() |
Sat, Nov 29 2008 2:10 PM | Permanent Link |
Leslie | Hi,
What is wrong with the syntax of this job? BEGIN declare Target varchar; set Target = 'DBName Backup On' + Cast(CURRENT_TIMESTAMP as Varchar)+ '.Bkp'; BACKUP /* Error #700 ... but instead found DATABASE --->*/ DATABASE DBName AS Target TO STORE "Backup" COMPRESSION 9 INCLUDE CATALOG; END Regards, Lelsie |
Sun, Nov 30 2008 7:31 AM | Permanent Link |
Fernando Dias ![]() | Leslie,
The problem is that BACKUP is not a PSM statement, so it must be executed as dynamic SQL from inside the job, for example: BEGIN DECLARE Target VARCHAR; SET Target = 'DBName Backup On '+CAST(CURRENT_DATE AS VARCHAR); EXECUTE IMMEDIATE ' BACKUP DATABASE AGV2Afm2009 AS "'+Target+'" TO STORE "Backup" COMPRESSION 9 INCLUDE CATALOG; '; END Also, if you use CURRENT_TIMESTAMP to generate the backup name you will end up with an invalid filename for the backup because of the separator characters in the time part. You should also remove '.bkp' from the name because EDB will automatically append the extension for the backup file. -- Fernando Dias [Team Elevate] |
Sun, Nov 30 2008 8:16 AM | Permanent Link |
Leslie | Thank you very much Fernando!
|
This web page was last updated on Wednesday, August 14, 2024 at 07:31 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |