Re: Separate foreign keys with shared ID space
Date: Sun, 1 Aug 2004 12:17:39 +0000 (UTC)
Message-ID: <Xns953891274E366Yazorman_at_127.0.0.1>
>> So you use SSN. Now you want to enter me in your database. What is my >> SSN?
>
> I'm not entirely sure what point you're making. Either you have one, in
> which case I must know it, and then I can enter your details. Or you don't
> have one, in which case, I can't enter your details.
Two cases:
- You're a stock broker, and you need to enter person-numbers for natural persons that pays taxes in your own country, since the tax authorities requires you to report their transactions and positions. But for customers that pays tax elsewhere, or are juridical persons you have no requirement. And there might be some shady customers which you should report, but which prefer that you don't.
- You are entering data about patients at a hospital. And here am I, an illegal alien, or just an unfortunate tourist, and you cannot enter me.
Well, if the system was designed by someone who religiously believed in natural keys you have a problem.
> But you are assuming that I would *want* to handle people without SSNs.
Yes, in most systems where you handle persons you want to that. You set up a web shop. You only accept customers that have an Australian SSN?
> The point is that, either my business rule states that two people
> *cannot* share SSNs (in which case, SSN is a good candidate for a
> primary key), or the business rules state some other point of
> uniqueness,
> It simply means the business rule gets more complicated. If I was
> designing a system that was to store US and British and Aussie citizens,
> I would have an 'ID' field that could accept the US SSN, the British
> National Insurance Number (assuming it still exists!!) and the Aussie
> Tax File number.
-- Erland Sommarskog, SQL Server MVP, esquel_at_sommarskog.se Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinfo/productdoc/2000/books.aspReceived on Sun Aug 01 2004 - 14:17:39 CEST