Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Final say: Field Naming Convention
Message
De
23/01/2002 18:19:58
 
 
À
22/01/2002 09:37:52
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Divers
Thread ID:
00608378
Message ID:
00609437
Vues:
18
I'll add my $0.02 here, for what it's worth:

1) Column names should be fully qualified whenever possible for future scalability and performance reasons. Yes, it's tedious to always add the server.tablename prefix, but if you ever have to connect to another database and/or server, it will be INSTANTLY beneficial. Plus it's self-documenting. This eliminates the need to prefix column names with abbreviations (and removes the potential for running out of two & three-letter combinations).

2) I'm of the old-style, Hungarian-notation column-naming school - "c" prefix for character, "i" for integer, etc. It has saved me countless hours of having to look up column types in other developers' stored procs. Plus it eliminates the possibility of reserved-word conflicts.

3) I prefix PK columns "PK_" and foreign key columns "FK_" (usually with the same column name as the parent, unless the situation dictates otherwise). Again, it's self-defense, as I can tell instantly what the column is. The choice of prefixes is habit, since my case tool of choice names the columns that by default. As long as you have some pattern, you're okay.

One last habit I've adopted is to put the columns in alphabetical order. Helps to find columns in large tables easier, and since we use Hungarian notation, all like-type columns are grouped together (which makes it easy to double-check defaults, null acceptance, and so forth.

JMHO.
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform