Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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


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.