Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>I am creating a new database should I prefix the fields with their type
Hi John,
You've heard some people go pretty strongly against prefixes for field names. Here's an alternative view: After years of not prefixing them, I now ALWAYS prefix. I've just been burned too many times (i.e. twice) using reserved words that I hadn't realized were reserved words. These issues came back to haunt me YEARS later, and took DAYS to figure out the problem. I can personally attest to the fact that using reserved words as field names can definately bite you in the rear big time. They can be very difficult issues to find and fix.
I just use single letter prefixes - i.e. "i" for integer, "d" for date, "c" for char, etc. They've never really proven useful in terms of needing to identify the type of field - usually that's pretty obvious, I find. They just provide a pretty good way of guaranteeing that you do not use reserved words, and by doing it in all cases and consistently, your system will be easier to follow.
Good luck,
David
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement