HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMajor

Is it okay to put dots in SQL Server database names?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
sqldotsokayputnamesdatabaseserver

Problem

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?

Solution

I think it's a very bad idea even if 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:

server_name.database_name.schema_name.object_name


Imagine what will happen if they see something like this:

MAIN-SQL.[MyApp.Sales].hr.CompetitorsProducts


or:

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


Keeping things simple is important.

Code Snippets

server_name.database_name.schema_name.object_name
MAIN-SQL.[MyApp.Sales].hr.CompetitorsProducts
[MAIN-SQL\EXPRESS].[MyApp.Sales].sch_HR.[Products From.Our-Competitors]

Context

StackExchange Database Administrators Q#1166, answer score: 39

Revisions (0)

No revisions yet.