SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Worst Practices - Part 1 of a Very Long Series!


Worst Practices - Part 1 of a Very Long Series!

Author
Message
jodiem
jodiem
SSC Rookie
SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)SSC Rookie (34 reputation)

Group: General Forum Members
Points: 34 Visits: 1
quote:

When working on tables I always keep a copy of the data dictionary handy and that's how I determine the data type and domain of the field.


Is there some report or query that you use for this? What information does it contain?

What do people think of having the whole database diagram up on the walls? Which is what we are trying to do at the moment - but it's 6 A0 size sheets of paper - very big. So if there is a more beneficial way to give this information to the coders, I would be very interested in others' comments.

Jodie



Andy Warren
Andy Warren
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: Moderators
Points: 11543 Visits: 2730
I've got one of those big diagrams of the SQL system tables - useful at times, especially during a discussion with someone else where you both easily see it. I think a lot of it depends on how often you need the document. Sometimes you want to look at the big picture, sometimes you're mired in detail! I've found the object browser in QA to be a quick and easy way to look at table level info.

Andy

Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
VegaMachine
VegaMachine
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1076 Visits: 4
While I do agree that changing column names in a table is generally a bad thing to do, I have to say that with proper DB design upfront you should never have to change names, also if you do come across a change that has to be made you should still be in a developement environment and not far enough along to cause serious headaches. With the use of business objects you would reduce maintenance by haveing your DB integration code located all in one place.



- Vega
Andy Warren
Andy Warren
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: Moderators
Points: 11543 Visits: 2730
I'll go along with the idea that if you've done a really good middle tier, you don't care as much about the column names. Or at least they are all in one place. I'm not sure that holds true - what about reporting, how many reports go through the business layer and not directly to the tables (Crytal Reports, etc)?

One other point - if you're truly working with a middle tier component, then why even worry about Hungarian, since only the middle tier developers will see them? Is it worth the effort then?

Im not complaining about your comments - I appreciate your contribution to the discussion!

Andy

Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
PBirch
PBirch
Right there with Babe
Right there with Babe (737 reputation)Right there with Babe (737 reputation)Right there with Babe (737 reputation)Right there with Babe (737 reputation)Right there with Babe (737 reputation)Right there with Babe (737 reputation)Right there with Babe (737 reputation)Right there with Babe (737 reputation)

Group: General Forum Members
Points: 737 Visits: 35
Good article. I'm not a fan of Hungarian.

Sometime down the line write an article about stored procedure naming conventions (my favorite gripe). I have developers who "automatically" name their stored procedures sp_ ("because Microsoft does").



Patrick Birch

Quand on parle du loup, on en voit la queue
Andy Warren
Andy Warren
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: Moderators
Points: 11543 Visits: 2730
Definitely. I use usp_ in general, usp_dba_ for my stuff that I prefer no else use/touch. Other ideas on this?

Andy

Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
Rajkumar-13982
Rajkumar-13982
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 1
I agree to the article for the case of column Names... but i am still happy with the Hungarian Notation(HN) being a BP for the case of programing. Being a VC%2b%2b programmer for quite sometime I am comfortable with the HN as it solves me lots of problems...especially for the scope case and also when the declaration is inside a class. As far as the column names go...I strongly go with the article...it's not a good idea for having Column Names in HN...this would add to the confusion. Column Names should be decide based on the business logic and not on Programmer Friendliness. If the latter happens... I would say that's a poor design.

PS: Please bear with my spelling/grammer mistakes...I am not that good in English.


~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~
It's the music that matters for a soulful experience... not the instrument.
~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~~*~
Andy Warren
Andy Warren
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: Moderators
Points: 11543 Visits: 2730
Dont worry about the spelling my friend - at least you HAVE a second language, more than I can claim:-)

Andy

Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
Andy Warren
Andy Warren
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: Moderators
Points: 11543 Visits: 2730
Ideally you have some kind of naming convention. Since ideals seem to rarely happen, I think "Something" would be ok as a column name. A good column name is descriptive without being overly long - I'd say between 3 and 12 characters. The best you can do is be consistent, don't mix styles, such as 'some_thing' in one table and 'somethingelse' in another. When I use my column names in code, I want the column name to be self describing so that someone doing maintenance work on the code can quickly and easily see what I am doing. I also prefer mixed case object names - SomeThing rather than SOMETHING.

Consistency is the BP.

Andy

Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
joseg
joseg
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 1
I think that you have to keep the current implementation of databases, must of us do not start a new implementation, if you do it,is ok. The user do not have to see complicated names in yours columns as we know. No one is going to change an aplication and columns name because the notation is not as BP or WP.

Jose Galan
joseg@pharmed.com



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search