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?

link|improve this question

25% accept rate
feedback

1 Answer

up vote 1 down vote accepted

Try [Square-Brackets] around the name

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

Your Answer

 
or
required, but never shown

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