Re: Database help
- From: "Ornette" <n.o.abstraits.p.a.m@xxxxxxx>
- Date: Sun, 1 Apr 2007 17:45:19 +0200
Hello,
I agree with you. You have also the problem "what will you do if both ID are
empty". Because you have to allow null values to do so. Not good...
I would add tables to do this.
Customers
ID
Type
ForeignKey on Contact or Business (or 2 keys if you prefer, but you can
use the smae key type for both)
Other Datas
Contact
ID
Other Data
Business
ID
Other Data
If you have individuals frome business, you can also add Adress table and
point to the table with a foreign key.
Look like you should use google a little bit and search for Relational
Database.
Ornette.
"Eliyahu Goldin" <REMOVEALLCAPITALSeEgGoldDinN@xxxxxxxxxxxx> wrote in
message news:OFYfsuDdHHA.3960@xxxxxxxxxxxxxxxxxxxxxxx
What will you do if for whatever reason both id fields will have values? I
would prefer having just one id field and a separate field "CustomerType".
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Hayden Kirk kirk mobilepc.co.nz>" <hayden <dot@> wrote in message
news:%23S6sTzCdHHA.2332@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
Having issues designing something in a database. I'm trying to make a
customer table. Problem is I am trying to determin if they are contacts
or busineses.
Like, I want to be able to bill individual clients as well as businesses
but If I do this there will be redundant data.
The solution I came up with was a customer table having two fields.
CustomerID and BusinessID. If the contact has one or the other read from
that table to workout what type of customer they are.
Is this the best way of doing it?
.
- References:
- Re: Database help
- From: Eliyahu Goldin
- Re: Database help
- Prev by Date: Using a Class Library with A Web Service
- Next by Date: Re: Dynamically added user control
- Previous by thread: Re: Database help
- Next by thread: CrystalReport on UserWebControl
- Index(es):
Relevant Pages
|