Include tablename in fieldname
I have never regretted the naming convention that I use. It has a few basic
rules that if used provide a somewhat self documenting and explicit system.
- Every field name in a table begins with 3 lower-case letters identifying
the table:
empFirstName
empLastName
empStreet
empDptID
jobTitle
jobDescription
(you should be able to determine which tables contain the above fields)
- The primary key field is an autonumber that repeats the first 3 letters
and adds "ID" so there are always 8 letters with a specific pattern:
empEmpID
jobJobID
prjPrjID
(you should be able to name the tables, data types, and index type)
- Foreign key fields follow the same convention. Find the field above
that is a foreign key to tblDepartments.dptDptID
- The usual don't include spaces or special symbols and
use upper and lower case for easy reading.
As I stated, this system has served me well particularly when working with
multiple developers. I have not always followed these rules when connecting
to other data sources.
--
Duane Hookom
Microsoft Access MVP
"Lars Brownies" wrote:
What's the general concensus about including the tablename in every field
name, like:
tblCustomer
ID_Customer
Lastname_Customer
etc.
Is it necessary? Should it be prefix or postfix?
Thanks,
Lars
.
|