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 |
Jacmac
Starting Member
11 Posts |
Posted - 2010-02-05 : 17:27:42
|
I've got a table of assets and a table of contacts. An asset may have a variable number of contacts associated with it. How should the asset table be designed to store contacts? Because of my programming experience, my thought process is that I'm attempting to store a variable sized 'list' of foreign keys in a column. |
|
Kristen
Test
22859 Posts |
Posted - 2010-02-06 : 01:09:50
|
I would just a third "link" table that joins Assets and Contacts. It only needs two columns - the Asset.ID and the Contact.ID (although you might add others - IsActive, DateCreated, that sort of thing. |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2010-02-06 : 06:33:13
|
A variable sized list of foreign keys contradicts relational principles. Also the thrid table option outlined will allow easier application of set based queriesJack Vamvas--------------------http://www.ITjobfeed.com |
|
|
Jacmac
Starting Member
11 Posts |
Posted - 2010-02-06 : 15:53:01
|
Yes can I see that the third table makes sense, thanks for the answer. |
|
|
|
|
|