|
|
|
SSCertifiable
       
Group: Moderators
Last Login: Thursday, May 09, 2013 12:38 PM
Points: 6,462,
Visits: 1,384
|
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, February 19, 2003 12:00 AM
Points: 14,
Visits: 1
|
|
Andy, thanks for the start of what I'm sure will be a very interesting series.
On Hungarian Notation, I agree that it's probably WP to use it on column names but if people want to change thier column names then there is a tool that will help - Speed Ferret www.speedferret.com. I like this tool because it does give you the ability to change your mind as the database grows and changes - there are a few restrictions to it however - it does not yet support SQL Server 2000 (I've used it a few times but with great care - ie back up the database first), and there's no way to change column names referenced in your ASP although it will work with VB. (for changing ASP I use windows Grep www.wingrep.com)
on Naming Conventions generally I've always stuck by the rule that It doesn't really matter what the naming convention is, as long as it is documented and ahdered to. A good BP/WP article/discussion could be had on the use of the tbl prefix before each table name (vw for views etc). Some people are passionately against it and say it adds time to reading the code. I use it personally because our DB has a view on each table and I need to know whether it's the view or the table when I'm reading a SQL Statement. Any other views on this?
Edited by - jodiem on 10/07/2001 8:09:31 PM
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, December 24, 2001 12:00 AM
Points: 8,
Visits: 1
|
|
I graduate from university last year and what you are saying is what i was taught. I irony is that been in the work place for 1 year i have found most of the databases within the company i work for do not follow the way i was taught/you have noted. It's a pain the the butt as it takes ages to understand the database.
Rock on, i wish more "IT/database proffesionals" would read and follow you suggestions, it would save agravation + time
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, June 04, 2003 12:00 AM
Points: 3,
Visits: 1
|
|
Good start to what i'm sure will be a very interesting series ! I am in the middle of creating a BP guide for my development team so I shall be keeping a close idea on the boards. My take on the last example of WP (hungarian notation for column names) is slightly different. The fact that it is considered a WP is surely more to do with the limitations of SQL Server than the actual practice being poor in that there is no global search and replace functionality with SQL Server. I guess that using hungarian notation in column names, where it is such a pain to change as the db becomes more sophisticated, really emphasises good analysis and design.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: 2 days ago @ 3:16 PM
Points: 2,749,
Visits: 1,405
|
|
I agree with using Hungarian notation for objects and variables.
I would NOT use it for anything that a user might see such as a column name.
I picked up the idea of using Hungarian Notation from Ivor Horton's C++ book and it seemed like a good idea. Although aimed at variables, pointers, properties and classes there was no reason to limit it to C++, VB etc.
Are there any agreed standards for SQL objects or indeed objects in general? I use:- Tbl_ identifies a table. Idx_ identifies an normal index. Pk_ identifies a primary key. Unq_ identifies a unique key. Vw_ identifies a view. usp_ identifies a user (non system) stored procedure uxp_ identifies a use (non system) extended stored procedure. df_ identifies a default. rl_ identifies a rule. ty_ identifies a user defined type.
If you are going to use some form of Hungarian Notation then it has to be adopted as a standard across the organisation.
LinkedIn Profile
|
|
|
|
|
SSCertifiable
       
Group: Moderators
Last Login: Thursday, May 09, 2013 12:38 PM
Points: 6,462,
Visits: 1,384
|
|
Thanks for all the comments so far! I have not tried Speed Ferret, but I do have a freeware add-in for VB that does much the same thing. David, I do like Hungarian for objects I think - with the exception of table. I know that's not exactly consistent! One thing to consider is that the one place in VB where it's recommended that you NOT use this notation is in public objects. If you're providing users with a class contained in a dll, all the methods and properties should be 'English', not 'Geek'!
Andy
Andy SQLShare - Learn One New Thing Each Day SQLAndy - My Professional Blog Connect with me on LinkedIn Follow me on Twitter
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, February 02, 2009 3:11 PM
Points: 1,
Visits: 5
|
|
Andy, I too am really looking forward to this series. I have never seen hungarian notation used in column names. I do agree it would be a disaster! The practice I use with columns is to append part of the table name to the column (except foreign keys). The classic Employee table is a good example. The column names might be empID, empLastName, empFirstName, etc. 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. It also helps (a BP of course) to have data standards. So e.g. if zip code is always a 9 character text field, any time I see zip code, I know the data type. Of course, this doesn't always work with legacy databases. Anyway, keep up the good work!
|
|
|
|
|
SSCertifiable
       
Group: Moderators
Last Login: Thursday, May 09, 2013 12:38 PM
Points: 6,462,
Visits: 1,384
|
|
|
|
|
|
SSC-Dedicated
           
Group: Administrators
Last Login: Yesterday @ 1:47 PM
Points: 31,406,
Visits: 13,722
|
|
I'm with Andy on this one. I used to use Hungarian notation in coding, but never in column or object names. I think it is a disaster. Tool or no tool, the rebuild time for a table might be way too high for a name change. One other note, since I've started working with .NET, MS does not recommend using hungariang notation, at least for C#.
Steve Jones steve@dkranch.net
Follow me on Twitter: @way0utwest
 Forum Etiquette: How to post data/code on a forum to get the best help
|
|
|
|
|
SSCertifiable
       
Group: Moderators
Last Login: Thursday, May 09, 2013 12:38 PM
Points: 6,462,
Visits: 1,384
|
|
|
|
|