Is prefixing table names with "tab" a good idea

  • Please indicate your opinion on the desirability on prefixing tables with "tab"

  • This will be useful only in VSTF or code-maintenance... As SQL Server cleverly distinguishes between objects, i dont think naming it with "tab" is mandatory..

  • I find this of dubious value. However, since you can also select from views and some functions, it might be of some use to do this. Personally, I assume that statements are against a table, and then add a prefix or suffix to the views/functions to indicate otherwise.

    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes

    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • Does it hurt anything? Not really.

    But what a total waste of space and time. Maintenance and long term readability is reduced, not enhanced. It's a throwback to the old days of Hungarian notation, which shouldn't even be used in code, let alone inside of database structures. No, no, no, no, no, no, no. Don't do this.

    Other than that, I'm fine with it.

    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 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd Edition
    Product Evangelist for Red Gate Software

  • It's something I personally hate. If you have the choice, avoide it.

  • A useful tuning technique may involve converting views to functions, or tables to views, etc.

    For example, you might create a second table, and then use a view over this table and the original one to give you identical functionality as before, without changing massive amounts of code. If you then see tblAAAA everywhere, you might be thinking you're looking at a table, when in reality it's a view. It might be an OK convention when it's correct, but when it's misleading, it's horribly confusing.

  • It all depends on you naming convention.

    In some cases the author of the naming convention may be tired of having to explain why tables are the only objects that lack a prefix therefore just to stop getting complains and keep naming convention consistent the "tab" or "tbl" prefix are born.

    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

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

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