Strange backup script?

  • BACKUP DATABASE "02" TO  DISK = N'C:\02.BAK'  WITH  INIT ,  NOUNLOAD, 

    NAME = N'SW backup',  NOSKIP ,  STATS = 10,  NOFORMAT

    This script runs fine in QA, and I tried to make a job out of it, but then things starts to happen.

    First the job doesn't run,

    I go into the "Edit Job Step", and try to change the 01 to 02 but then it comes up with an error:  Incorrect syntax near '01', are you sure this is what you want?

    If I go into the BOL the helpfile says that I should not use any  quotation before the database that I Backup to. like BACKUP DATABASE 01 TO............, but then I can't run it in QA or JOB.

    The thing is - If I have only text, instead of number in the BACKUP DATABASE TEST - it runs just fine both with the  quotation. I'm conpletely lost here. How can I make the job to work with numbers in database? Does anyone know. Please help me


    -Lars

    Please only reply to this newsgroup. All mails would be bounced back.

  • Try to use [] instead.

    BACKUP DATABASE [02] TO  DISK = N'C:\02.BAK'  WITH  INIT ,  NOUNLOAD, 

    NAME = N'SW backup',  NOSKIP ,  STATS = 10,  NOFORMAT

     

  • WOW What can I say - Thanks


    -Lars

    Please only reply to this newsgroup. All mails would be bounced back.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply