Re: Surrogate Keys
From: Joe Celko <71062.1056_at_compuserve.com>
Date: 2000/05/27
Message-ID: <8gneuk$83v$1_at_nnrp1.deja.com>#1/1
Date: 2000/05/27
Message-ID: <8gneuk$83v$1_at_nnrp1.deja.com>#1/1
>> There are so many related tables in my database that I am running up
against Access 97's 10-field limit on primary keys. One obvious
solution is to use a surrogate key, i.e., instead of using the "real"
fields that should compose the primary key, use instead a made-up
number to serve as the primary key. Is this a reasonable solution? Any
suggestions on alternate soluation would be appreciated. <<
In order of preference:
- Get rid of ACCESS; it stinks anyway and will just get you in trouble
- Redesign the database -- I have never seen a ten column primary key in my life.
- Use a hashing function on those columns to build the surrogate key
- Generate a random number with a check digit and use it as the key.
--CELKO--
Joe Celko, SQL and Database Consultant
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Sat May 27 2000 - 00:00:00 CEST