Database Design

  • Is there such a thing as a convention or rule for a short name in a database table?

    A co-worker of mine suggests it must be the same as the descriptive name but with all the spaces removed.

    e.g. Afterglow Lighting Company becomes afterglowlightingcompany

    Does this sound correct?

    Or are there any other rules I should follow?

    Thanks

    Rob

  • try this!!!!!!!!!!!

    http://www.iltanet.org/files/tbl_s17EventDocuments/File102/906/Upgrading%20to%20Microsoft%20SQL%20Server%202005.ppt

    msdn2.microsoft.com/en-us/library/bb219483.aspx

    nayyeri.net/archive/2007/08/27/synonyms-in-sql-server-2005.aspx

  • Pick any rule you want and then follow it consistently.

    Personally, I'd use camel case, or bumpy case so that the column would be:

    AfterGlowLightingCompany

    But honestly, if you don't mind a bit of typing, or if you use SQL Prompt, you could just do this and leave the spaces in:

    [Afterglow Lighting Company]

    Just pick a method & stick with it. Nothing worse than seeing a set of tables with columns like this:

    [Afterglow Lighting Company]

    maxafterglowsalescountbyregion

    AfterGlowBeginDate

    alcUpdDtRecNo

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Michael Hotek (former SQL Server MVP) wrote an article about naming conventions on his site. Many moons ago we applied it to our organization (it was written in the SQL Server 7.0 days).

    Naming Convention Standards

    He gives his arguments as to why he does things certain ways and while we didn't follow everything he recommended, he gave good reasons for what he suggests. As has been already stated, the biggest key is consistency.

    K. Brian Kelley
    @kbriankelley

  • The naming convention is whatever you choose it to be.

    However, it is only a convention if everyone on the development team is following it. (Therefore, there is no convention going on around here ....)

    Scott

  • Thanks Guys,

    Your comments are much appreciated. I can see where the inconsistencies have crept into our current application, and hope to lay down a standard with it's replacement.

    What surprised me was the way this coworker was soooo definite that she was right about the short name.

    Cheers

    Rob

  • Camel case ftw, I use the same method for all my programming and seems pretty standard in the Open Source scripts I use

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply