Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cd in Table Names?

Status
Not open for further replies.

Gooser

Technical User
Jun 28, 2006
803
US
I am MSSQL Server Database Admin for a smallish not-for-profit. Our 'data manager' is proposing that we append the letters 'Cd' to the end of any lookup table. This seems ludicrous to me, but I haven't been able to synthesize my argument against this practice. Any help greatly appreciated.

v/r

Gooser

Why do today
that which may not need to be done tomorrow [ponder] --me

The Bailout We Need
 
...further, the aforementioned plan would lead to schemas resembling this:

Code:
OccupancyCD
-----------------------------
OccupancyCdId    int
OccupancyCdCd    char(8)
OccupancyCdNm    varchar(32)
OccupancyCdDescr varchar(256)

Doesn't that seem crazy? A column named ColumnNameCdCd?

--Gooser
 
Just out of curiosity, what is CD supposed to mean?

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Doesn't make much sense to me. I would spell Code if we mean code like OccupancyCode and OccupancyName for Name.

 
Crazy. You should suggest that you append Crazy to the end of everything.

[tt]
OccupancyCrazy
-----------------------------
OccupancyCrazyId int
OccupancyCrazyCd char(8)
OccupancyCrazyNm varchar(32)
OccupancyCrazyDescr varchar(256)
[/tt]

Seriously!

I am NOT a fan of abbreviations. Not even a little. In fact, the only abbreviations you will find in my database is ID (short for identification). Furthermore, I think it is completely ludicrous that "abbreviation" is such a long word. Who's bright idea was that!

Personally, I would prefer things to be spelled out (not to use abbreviations). Also.... why bother adding extra words if they don't add to the clarity.

Think about it this way....

Will a user EVER see a table name or column name? Probably not. So, who benefits from the name change? developers. Does adding CD to end end of certain columns and table names improve the clarity of the code? I don't think so.

In my opinion, you shouldn't do this.



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
I think he has some sort of tool he wants to use to generate queries automatically, and that tool requires a way to identify lookup tables by their name. So, he's trying to append Cd to the end of the table name so he can use that tool.

In my experience any one-size-fits-all solution that writes it's own code (I know, MS FrontPage) is garbage. One size might fit all, but it won't fit anybody well.

Thanks guys!
--GooserCD
 
Maybe he can create views with the CD suffix with permissions for and use only by his query-generating tool. I agree though, it's a bad idea to rely on a tool to generate all of your queries. They might provide a good starting point, and even do a decent job for generating insert/update/delete stored procedures, but not for potentially resource-intensive queries.
 
Be careful to not end up with NULL = NOT NULL and ISNULL(NULL) <> ISNULL(NOT NULL) :)))
 
How about:

Code:
SELECT 1.person_id
     , 1.person_nm
     , l.role
   FROM person AS 1
   JOIN permissions AS l
      ON 1.person_id = l.person_id

?

v/r

Gooser

Why do today
that which may not need to be done tomorrow [ponder] --me

The Bailout We Need
 
Tell him that it's stupid and that his tool is junk and that if he's going to write queries against the database he should learn to do it correctly. Renaming all the tables, and changing all the applications and procedures and code that hits those tables so that his tool will work it stupid.

Feel free to point him to this post if he has any questions for me.

Denny
MVP
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / SQL 2005 BI / SQL 2008 DBA / SQL 2008 DBD / SQL 2008 BI / MWSS 3.0: Configuration / MOSS 2007: Configuration)
MCITP (SQL 2005 DBA / SQL 2008 DBA / SQL 2005 DBD / SQL 2008 DBD / SQL 2005 BI / SQL 2008 BI)

My Blog
 
And no I don't pull any punches.

Denny
MVP
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / SQL 2005 BI / SQL 2008 DBA / SQL 2008 DBD / SQL 2008 BI / MWSS 3.0: Configuration / MOSS 2007: Configuration)
MCITP (SQL 2005 DBA / SQL 2008 DBA / SQL 2005 DBD / SQL 2008 DBD / SQL 2005 BI / SQL 2008 BI)

My Blog
 
If the tables already exist appending a code to the end of the name could break a significant amount of code. This is one argument against the practice.

"NOTHING is more important in a database than integrity." ESquared
 
Whoa! Hold on for a minute. I'm pretty much against any form of "Hungarian Notation" myself but I can see a use to this little slice of madness if the lookup tables are static. It will make it really easy to ignore the static tables when it comes to a reindexing job. It may not be the best way (I'd rather check the frag levels in case someone does a shrink somewhere), but I can see a method to the madness.

--Jeff Moden
-------------------------------------------------------------------------------
"RBAR" is pronounced "ree-bar" and is a "Modenism" for "Row By Agonizing Row
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top