question

GPO avatar image
GPO asked

Stupid table aliases

OK I admit this is a commentary more than a question, but I have to get it off my chest. When you're aliasing a table, for pity's sake put some thought into it. I've seen two unrelated databases in the last two days which both have tables called **notes**. And the code all over the place aliases **notes** as **not**. For the sake of two characters you lose an awful lot of readability. That's all I'm saying. No it isn't. As for you meddling miscreants (and you know who you are) who alias every table as T1, T2, and T3. Come on, please. What does that tell anybody? Am I the only one who gets annoyed by this kind of thing or should I get myself some real problems to worry about? :-)
t-sqlsyntaxhumor
5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Fatherjack avatar image Fatherjack ♦♦ commented ·
+1 for coming on here and venting your frustration rather than at a client. Is the SQLTherapy domain taken I wonder?
2 Likes 2 ·
Shawn_Melton avatar image Shawn_Melton commented ·
Sounds like you mess with BMC product called Remedy maybe. They created all their views with Letter+NumberSequence
1 Like 1 ·
ThomasRushton avatar image ThomasRushton ♦♦ commented ·
@meltondba hateful, hateful POS. *shudder*
1 Like 1 ·
ThomasRushton avatar image ThomasRushton ♦♦ commented ·
Remedy has nothing to do with health. It's a piece of support / helpdesk type software, that does incident / problem / change management things. Hateful.
1 Like 1 ·
GPO avatar image GPO commented ·
Any database that is made for Health professionals or in any way with the involvement of Health professionals will suffer maladies like these. ("Oh but we're different. Anything you've ever learnt about database design you can forget. Those rules don't apply in our world.") I don't know "Remedy" but maybe the name gives something away?
0 Likes 0 ·
Tim avatar image
Tim answered
Your examples are about as bad as what I encounter. A previous DBA at my company used the alphabet. Everything started with A and worked its way up. I mean really, do I need a legend to have to reference which table is C and which is E, etc. I agree with you. Table aliases need to be meaningful just like table names, indexes, etc. You are not alone.
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Tim avatar image Tim commented ·
Now if it was turkey maybe, but a 16 ounce filet perfectly cooked. YUM.
3 Likes 3 ·
KenJ avatar image KenJ commented ·
49 seconds. thought that PASS steak dinner would slow you down some :)
2 Likes 2 ·
KenJ avatar image
KenJ answered
With all due respect, I'd lean towards getting some real problems. Life is too short to get all wrapped up in these kinds of details. As you come to these crazy aliases, just leave the code cleaner than you found it and move on, knowing you've done the right thing for yourself and your profession
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Matt Whitfield avatar image
Matt Whitfield answered
Get your team an editor that auto generates aliases for tables. I know mine does it (press TAB after any identifier) and I'm pretty sure SQL Prompt does it. That makes it a little bit better. Then, when you've done that, get your team an editor that allows alias name refactoring.
4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Tim avatar image Tim commented ·
Ha Ha. @fatherjack, I can see your point about JLS.
2 Likes 2 ·
Fatherjack avatar image Fatherjack ♦♦ commented ·
yeah Prompt does it but be careful, it uses Camel Cased letters to generate aliases so you end up with some distasteful ones - only last week one alias I got was JLS. You can fix your own in Prompt too so a certain table always gets a defined alias.
1 Like 1 ·
Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
@Fatherjack Explain it to the poor stupid American, why is JLS bad?
1 Like 1 ·
Fatherjack avatar image Fatherjack ♦♦ commented ·
1 Like 1 ·
Grant Fritchey avatar image
Grant Fritchey answered
I had to deal with a "logical" modeling team that insisted on the stupidest standardized abbreviations you've ever seen, but my favorite was the abbreviation for "Deductible." It was turned into "ddltbl." Maybe it's just me, but should an abbreviation ADD letters? Where did the second "L" come from? Oh, and best of all, we were required to use this, regardless of the fact that it was screwed up. So you can go to company X today and see "ddltbl" all over the place. In short, I feel your pain.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.