Defining Column Names

  •  

     In SQL 2000, what are the basic rules to define column names in a table?

  • Hi - check identifiers - overview in BOL. Basically

    1 to 128 chars. Start with a letter or underscore. I think you can start with # or @ but it gets confusing.

    Some people allow spaces e.g. 'First Name' but you have to code it [First Name]. Some folk replace the space with an underscore, I find this  hard work when reading out to someone. It also uses more characters than is needed. CamelCaping is my choice e.g. 'FirstName'

     

     

     

  •  Thank You Allen.

      Is there any other important points to be considered at the time of giving field names?

     

  • A good one I picked up was not to use plurals. E.G use Week not Weeks

  • After the system reequirements ( see BOL) everything else is convention.  Never use single character column names unless you are into pain.  Whatever you come up with keep it consistent.  Either always use plural or never use plural, Always cap the first letter or never cap the first letter.  Consistency is the key to readability. 

    Scott

     


    Kindest Regards,

    Scott Beckstead

    "We cannot defend freedom abroad by abandoning it here at home!"
    Edward R. Murrow

    scottbeckstead.com

  • Thank You very much for all u'r replies.

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

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