...bringing you notes from the field...

Tag Cloud


Why does "use db" with a hyphen throw "Incorrect syntax near '-'" ?

I think this SQL Server x.x  oddity goes back to the old Sybase 4 days!

If you want to use a database name that's been dubbed something like 'paula-objects' and type out:

use paula-objects

then execute the request, you'll get the error message:  Incorrect syntax near '-'

just type this instead:

use [paula-objects]

when you execute the request, the syntax error will clear up!


  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Feedback

# re: Why does "use db" with a hyphen throw "Incorrect syntax near '-'" ?


This is exactly my very first time that i take a look at this web-site. I recently found a variety of attractive things in your weblog notably this discussion. From the numerous

responses on your writings, I suppose I am not the only one getting all the excitement right here!
cosplay costumes 3/28/2011 5:36 AM | Cosplay Wigs