Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am attempting to restore a Blackberry configuration database on Microsoft SQL Server 2005. The command goes like this:

restore database besmgmt-test from disk = "C:\besmgmt-test.bak"; with move "besmgmt-test" to "E:\Data\besmgmt-test.mdf", move "besmgmt-test_log" to E:\Logs\besmgmt-test.ldf"

When I try to execute it, I receive the error "Incorrect syntax near '-'."

I've figured out that it doesn't like the dashes in the database's name, because I tested it out on another database without dashes. Even tried putting quotes around the database name in the command, but still received an error.

Is there any way around this besides changing the database's name?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Try [Square-Brackets] around the name

share|improve this answer
    
Thank you! That worked like magic. –  wahle509 Jan 29 '10 at 18:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.