Hi,
I am in the process of creating a medical database (Using SQL-Server 2005) which records information about blood samples that arrive for testing at our centre. At times we have to store additional information about the samples that arrive and the patients that these samples were taken from.
These 'parameters' cannot be predicted at design time. Therefore we have created a 'Parameters' table which stores the names of these parameters. Examples of these parameters could be therapy start date (date), viral load (int), height, weight (float).
---Parameters
-ParameterID (int)
-ParameterName (varchar)
-ParameterDataType (varchar)
We have also created a ParameterValue table which stores the value of these parameters. ie:
---ParameterValue
-ParameterValueID
-ParameterID (Foreign key with Parameters.ParameterID)
-Value (varied)
The problem comes from not knowing how to store dates, ints, varchars and floats in the Value field in ParameterValue. Is there any better solution than having a different field to store each of the datatype possibilities?
Thanks