Naming Convention

  • G'd evening!!!

    Can some one tell me if there is a naming convention for the sql objects?. Actually i use prefixes as i see most of the people use... But i don't know why do i do it i would like to have a better reason insted of say:  "Because every body do".

    Any help will be apprecited.

    Regards

    Estuardo

     

    Manifest plainness,Embrace simplicity,Reduce selfishness,Have few desires.
    Lao-t'ze.

  • This was removed by the editor as SPAM

  • Estuardo,

    There is no standard naming convention for SQL objects, however most people tend to use very simalar prefixes, and some people prefer to use suffixes.

    The reason people use prefixes and the like is so when you have 500 stored procedures you can organise them by sorting them alphbetically and having all spDelete...., spUpdate...... etc all grouped together instead of having to hunt through every object to work out what it is doing.  Also, it makes a clear distinction between tables, views, triggers etc.

    If you do a search on this site you will find a number of discussions about naming conventions.

    Cheers,

    Angela

  • There's a free e-book available at this URL...

    http://www.wingenious.com

    It discusses naming conventions and several other database architecture topics in the context of SQL Server.

     

    Creator of SQLFacts, a free suite of tools for SQL Server database professionals.

  • G'd Afternoon!!!

    Angela: Thank you very much for your reply. You're right. Some times could be better to group the objects by the task they perform to avoid long names and complicated sufixes and abreviations.

    Wingeniuos: Deeply thank you. That's exactly what i was looking for. I know any one can go to the link you kindly supply, but i also want to let here some of the information about the naming convention i found in the book

    Object Type                                           Object Prefix

    Table                                                    

    tbl

    Stored Procedure                                     

    usp

    User-Defined Function                              

    udf

    Trigger                                                   

    trg

    View                                                      

    qry

    Index                                                     

    idx

    Key Constraint                                         

    key

    Key Constraint                                         

    keyPK Primary Key

    Key Constraint                                          

    keyFK Foreign Key

     

    I must say that is the fist time i see the usp Prefix as well as qry (for views). Now i have a good starting point

    Thank you very much to both.

    Regards

    Estuardo

     

    Manifest plainness,Embrace simplicity,Reduce selfishness,Have few desires.
    Lao-t'ze.

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

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