• RonKyle (2/13/2013)


    Also, it's extremely inconsistent unless you also name all your tables tblXXX (and DO NOT, EVER, do that, ).

    Why would you never do this? I've seen dimension tables prefixed Dim and fact tables prefixed Fact. I use dtbl and ftbl. With my tables, I have tbl, tlkp, trel, xtbl and stbl. I find this very useful when going back to the design long after it's created to understand what I've done.

    As for the stored procedures, I'll use add_, tfm_, sel_ and others. Again, this helps me remember it's purpose when going back to it later.

    I don't have many views, but it helps to have at least vw_ if only to distinguish it from tables.

    I've been doing this a long time and seen the benefits. Without some real factual reason, I don't think it's a good idea to tell someone to never ever use the system.

    I know what you mean about wanting to know the purpose. This is actually quite useful. I prefer to use a suffix for this type of thing instead of a prefix. This serves two main advantages. First it will keep like items grouped in SSMS. And secondly I find it makes it far easier to code with. Say you have a Product and you need the basic CRUD sprocs. With your naming convention you would have add_Product, sel_Product, del_Product, upd_Product. Those are certainly clear what they do but they are hard to code with and in SSMS you will have stuff scattered all over. If instead you moved it to the end like this. Product_add, Product_sel, Product_del, Product_upd. Now when you are coding you think I need the Product sproc, intellisense will now show you only those that start with Product. For me I also think first of the object I am working with and then what I need to do to it. Just my 2¢.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/