Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Storing/referencing users
Dave wrote:
> Is it best practise to:
>
> 1) Store users in a User table, with a numeric UserID as primary key, and
> reference these users in other tables using that UserID as a foreign key?
> Also, this would require an additional username field.
>
> or
>
> 2) Store users in a User table, with a text Username as primary key, and
> reference these users in other tables using the Username as a foreign key?
>
> TIA.
It is best practice to state the version of the database and the
business rules. Is each individual user logging in with the same
userid and password or does each one have their own? Do users have
a unique surrogate key such as an employee id number or are you
talking about creating a new purely arbitrary numbering system?
How do other applications in the organization identify users such
that you can exchange data between systems. Where do user names come
from? Could their be two Bob Joneses? How are names to be maintained?
The simple answer is that there is no "right" way.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Sat Jun 03 2006 - 12:44:29 CDT
![]() |
![]() |