Data storage of expanding data

Hi all. I have a novice question.

What is the best way to store data that can expand? Example: patient allergy to medication -- result could be no medication allergy or 10 medication allergies. I need to be able to store each allergy for future evaluation or formatting. Since I can't predict the number of allergies do I create a table with allergy1...allergy100 or save the allergies in as a string in one allergy field?

Any help would be appreciated.

WKinney

[476 byte] By [WKinney] at [2007-12-16]
# 1
Hi,
Well, you could create a table named allergy, with an PatientId and AllergyMedication field. The idea here is to create a child table for your allergies medications. Since medications for allergies is somewhat dynamic, creating a table with a hundred fields would just bloat your database...

So, when you query the table allergy, just specify the patientId and you'll get all the allergy medications for a single patient...

cheers,
Paul June A. Domag

PaulDomag at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified