Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
chacimulch
Starting Member
4 Posts |
Posted - 2008-06-03 : 09:07:22
|
Hello,First time poster. I have a database design question. I just read the article on table inheritance but i still do not know if I'm doing this right.Say you have an organizations table and a persons table like the ones below with a many to many relationship like these three tables:Organization:AutoId TaxId NamePerson: AutoId FirstName LastNameOrganizationsPersons:AutoId OrgAutoId PersonAutoIdNow the question is that an organization and a person both need to access the address table.Is it better to have a PersonsAddress table and an OrganizationsAddress table, or is it better to have some sort of AddressAccess table that the persons and the organizations tables both relate to and have some sort of type field in there that specifies Org or Person?Thanks ahead of time for any help. |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-06-03 : 09:10:02
|
moved from article discusion since that forum is meant to discuss only posted articles. Welcome to the team chacimulch!_______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.0 out! |
|
|
chacimulch
Starting Member
4 Posts |
Posted - 2008-06-03 : 09:16:58
|
I'm not exactly sure what you mean by this? Did I post this in the wrong place? |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-06-03 : 09:17:38
|
yes article discussion is meant as a comments section for articles posted on the main page._______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.0 out! |
|
|
chacimulch
Starting Member
4 Posts |
Posted - 2008-06-03 : 09:27:21
|
so what exactly do I need to do to post this so someone will try to help me? Sorry first time user. |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-06-03 : 09:44:47
|
here is a good place. that's why moved it here.regarding your problem:i'd probably go with the AddressAccess table and a type field. so if you ever have to add a new type that has address then you just add a new type and not a new table._______________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.0 out! |
|
|
chacimulch
Starting Member
4 Posts |
Posted - 2008-06-04 : 11:37:19
|
FYI for anyone who is reading this. It turns out that using an access table will not work if you enforce the foriegn key constraints to the other tables that will access it. If one of the tables does not contain the value that you are trying to insert, then you cannot insert it. So.. all tables that are linked to the lookup table must contain that value. Not really useful because we want to enforce our relationships. |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
|
|
|
|