Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2007
    Posts
    1

    Unhappy Unanswered: - in the Database name.

    hello all
    I hope this is a simple question.
    I just added some new databases to a script of ours and I am having a slight issue.

    The line or code looks like this.
    BACKUP DATABASE PMDB-COMP-TEST to disk = 'C:\SqlRollbak\pmdb-comp-test.bak'


    Osql does not like this at all.
    I get a syntax error:
    1> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> Msg 170, Level 15, State 1, Server SDBASE101, Line 12
    Line 12: Incorrect syntax near '-'.
    Msg 170, Level 15, State 1, Server SDBASE101, Line 13
    Line 13: Incorrect syntax near '-'.
    Msg 170, Level 15, State 1, Server SDBASE101, Line 14
    Line 14: Incorrect syntax near '-'.
    1>

    I am assuming it is the hyphens in the Database name.

    Please help...
    Last edited by Kenclarke01; 12-14-07 at 19:47. Reason: Bad spelling

  2. #2
    Join Date
    Feb 2003
    Location
    India
    Posts
    216
    just put [] around the name .....[PMDB-COMP-TEST]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •