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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to track 1000 items in a sql table

Author  Topic 

gschimek
Starting Member

1 Post

Posted - 2009-02-24 : 21:28:59
I'm looking for some design advice. I'd like to be able to track a person's participation in up to 1000 events using a sql table. The only way I've been able to think of to do that would be to have a table with 1000 fields: name, event1, event2, event3, etc, and have all the event fields be True/False to be able to track if they've participated or not. But there seems like there should be a better way to do that than to have a table that's 1000 fields wide.

Any thoughts on this?

LoztInSpace
Aged Yak Warrior

940 Posts

Posted - 2009-02-25 : 01:04:05
Person table
Event table
PersonEvent table with a PK of personID and eventID
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-02-25 : 03:02:21
See http://www.datamodel.org/NormalizationRules.html



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-25 : 09:08:46
just use event type as a field in event table to identify which event it corresponds. then use like what loztinspace told.
Go to Top of Page
   

- Advertisement -