Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

If I use a database name with a dot in it in SQL Server (2005 or 2008), something like "MyApp.Sales", will this cause any problems?

share|improve this question
try to use "-" (minus) –  garik Feb 10 '11 at 22:29
Thanks to both Marek and Eric for your answers. –  Sean Kearon Feb 11 '11 at 9:36
if you use '-' you'll need to contain the DB name in [] when called from sp's and in the connection string in your apps. '_' is a good separator, or CamelCase.. –  Andrew Bickerton Apr 5 '11 at 11:35

5 Answers 5

up vote 28 down vote accepted

You can, but I wouldn't. You would always have to wrap the DB name with square brackets such as [MyApp.Sales].

So to recap: if you value your sanity, don't do it.

share|improve this answer
Also refer to: support.microsoft.com/kb/909264 for rules of what can and cannot be done for NT based names. –  jcolebrand Feb 10 '11 at 21:13

I think it's a very bad idea even if it technically possible.

Over the years I found out that many people have trouble understanding the four-part naming convention even though it seems pretty obvious:


Imagine what will happen if they see something like this:



[MAIN-SQL\EXPRESS].[MyApp.Sales].sch_HR.[Products From.Our-Competitors]

Keeping things simple is important.

share|improve this answer

In case someone else encounters this question...

Keep in mind that it is not only a bad idea because users might be confused, but also because some tools might get confused.

Even Microsoft itself has problems with this. If you try to connect your database to an excel sheet using Microsoft Query (via ODBC), you get a configuration wizard which lets you choose the database you want to connect to. However choosing a database that contains a dot will produce an error stating that the server could not be found. It seems that the wizard does not check if the values needs escaping and blindly concatenates the identifiers.

There are of course workarrounds, but you save yourself some trouble by not doing this from the start.

share|improve this answer

One of our suppliers has chosen to introduce the schema name: [System.Activities.DurableInstancing]. It's broken our dataload tool, so we now have further development to cope with their weirdness. Just don't do it. Use a '-'.

share|improve this answer

There are many characters allowed in names, but, convention and common sense limits special characters usage. '_' (underscore) is the proven safest separator and maintains readability ease.

share|improve this answer

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.