Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

Database Naming Convention Expand / Collapse
Author
Message
Posted Wednesday, July 31, 2013 1:51 PM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 27, 2014 1:20 PM
Points: 9, Visits: 146
I have seen lots and lots of commentary and comments about naming SQL Server database objects. But what about the name of the database itself? Is there a definitive best practice standard for the naming of a relational database? Should the name be limited to a few characters? Should it be long and verbose? Somewhere in-between?

I would appreciate any thoughts everyone might have on this topic.

Thanks
Post #1479674
Posted Wednesday, July 31, 2013 3:13 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Today @ 8:51 AM
Points: 318, Visits: 1,085
I've never seen any convention on this. It's best to give a DB a short meaningful name with no spaces. Sometimes DB names may be for example suffixed with '_DEV', '_TEST' etc if you've got development databases on the same server. If you've got a number of DBs with very similar names it can be confusing so avoid this.
Post #1479713
Posted Wednesday, July 31, 2013 3:18 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 9:21 AM
Points: 17,977, Visits: 15,981
laurie-789651 (7/31/2013)
It's best to give a DB a short meaningful name with no spaces.


I agree with that. Make the database meaningful or even playful if you want. Spaces in the db name are a pain but they can be used in the db name.

The key is that you know what the database is and represents.




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Post #1479716
Posted Wednesday, July 31, 2013 3:36 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: 2 days ago @ 6:54 AM
Points: 820, Visits: 2,117
Most would probably say it's overkill, but I prefix my OLTP databases with db, my staging areas with sa, and my OLAP database with dw. The names are otherwise short and clear.


Post #1479723
Posted Wednesday, July 31, 2013 4:52 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 2:25 PM
Points: 7,868, Visits: 9,607
laurie-789651 (7/31/2013)
I've never seen any convention on this. It's best to give a DB a short meaningful name with no spaces. Sometimes DB names may be for example suffixed with '_DEV', '_TEST' etc if you've got development databases on the same server. If you've got a number of DBs with very similar names it can be confusing so avoid this.
What an utterly horrible idea. So when my content_music and content_general databases go into production the system fails miserably because all the testing was done with SPs in content_general_test (whose name is changed to content_general in the release process) referring to tables in content_music_test (whose name is changed to content_music in the release process, so that content_music_test exists only on the test system, not on the production system).

OK, it's not likely to happen, if your release processes are reasonably professional. But I would strongly recommend not giving it the slightest chance to happen, and sticking "_TEST or _DEV or other postfixes on the database name in various stages of design, development, test, system test, pre-release validation, everything before release is just giving this particular failure a chance to happen in production.


Tom
Post #1479737
Posted Wednesday, July 31, 2013 4:56 PM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 27, 2014 1:20 PM
Points: 9, Visits: 146
So what do you all think about database names as short as 5 characters in length? Which is a standard that is mandated where I work?
Post #1479738
Posted Wednesday, July 31, 2013 5:00 PM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 27, 2014 1:20 PM
Points: 9, Visits: 146
Oops, sorry. The mandated standard here is 4 characters vice 5.
Post #1479739
Posted Wednesday, July 31, 2013 5:05 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 2:25 PM
Points: 7,868, Visits: 9,607
Nemeaux (7/31/2013)
So what do you all think about database names as short as 5 characters in length? Which is a standard that is mandated where I work?

Sounds crazy to me, for anything I've worked on. But I imagine there could be contexts in which it makes sense. So is where you work such a context? If so I'd love to hear about it, because I'm always interested in discovering things that are strange and new to me.


Tom
Post #1479741
Posted Wednesday, July 31, 2013 5:13 PM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, October 27, 2014 1:20 PM
Points: 9, Visits: 146
I really don't think where I work is such a context. I can't really imagine limiting "production" database names to 4 characters in any context. Something about defeating the self-documentation aspect of longer names eludes me.

By the way, I didn't make nor do I subscribe to the aforementioned standard. I'm just searching for a rationale for the shorter database names, aside from laziness in referencing a database name in code.
Post #1479745
Posted Thursday, August 1, 2013 4:52 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 10:07 AM
Points: 14,034, Visits: 28,406
Clarity, clarity, clarity.

You need to make things clear. Keeping the names arbitrarily short does nothing but obscure meaning. You want to know what things are, quick, clear and simple. In fact, this should be your naming standard for everything. Keep things clear.

I'm also completely against naming databases based on the environment they are in. That makes things EXTREMELY difficult to manage for testing, coding, rollbacks from production, etc.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server Query Performance Tuning
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1479875
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse