Subject | Re: [firebird-support] Re: Auto-increment and generators |
---|---|
Author | Delphi Programming |
Post date | 2004-02-11T13:45:19Z |
As I read this. this is a "database design" question, not just a Firebird question - and
the statement about "primary keys should not contain business data" applies to ALL
databases.
What happens if one day a user changes his UserID ? If you use a unique
"RecordID" concept (for the primary key) then all your relationships between tables
(based on the PK) won't be broken.
Just as an example, we inherited an application that used Social Security Numbers
(SSN) as the primary key and all relationships were based on that. Worked fine until
you needed to change a SSN because someone entered it wrong.
the statement about "primary keys should not contain business data" applies to ALL
databases.
What happens if one day a user changes his UserID ? If you use a unique
"RecordID" concept (for the primary key) then all your relationships between tables
(based on the PK) won't be broken.
Just as an example, we inherited an application that used Social Security Numbers
(SSN) as the primary key and all relationships were based on that. Worked fine until
you needed to change a SSN because someone entered it wrong.
On 11 Feb 2004 at 8:00, h_urlaf wrote:
> --- In firebird-support@yahoogroups.com, Phil Shrimpton <phil@s...> wrote:
>
> >
> > Repeat after me, Primary Keys should not contain business data....
> > Primary Keys should not contain business data....
>
> I don't need to; it already isn't the case. The user has a UserID,
> which is his PK. He *also* has a mailbox ID, which is 'bussiness
> data'. It must be unique, and since most clients don't care what it is
> (do not wish to link it to bussiness data), we would prefer to
> auto-generate it, and offer the client an interface to change the
> auto-generated mailbox numbers to numbers that are meaningful within
> the organization.
>
>
> That is exactly what I have. We don't know what bussiness data a
> customer will choose for the mailbox ID, *if any*. All we know is that
> it will be numeric, and unique.
>
> Emiliano
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
***************************************************************
You can enter a weekly drawing to win a dozen roses free at:
www.flowerniche.com/index.html#winroses
***************************************************************
Visit Our WebSite at
www.geodentech.com
*********************************************************
This email and files transmitted may contain privileged information.
Any unauthorized disclosure, use or dissemination, either whole or partial, is
prohibited.
If you receive this message in error please return it to the sender and delete all
copies.
Thank you