Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Database Design Expand / Collapse
Author
Message
Posted Friday, June 27, 2008 6:40 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, September 11, 2013 5:24 AM
Points: 40, Visits: 431
Hi,

I am designing survey database and for one entity I need to store dynamic field's Name and his data this data will change for each survey.

So, For this I have created one table with 8 fields of different datatype 3 varchar, 3 Int and 2 DataTime.

Now, user can use these fields to upload the data. Before upload they will define the field names for the specific survey, And ensure that data type of the value should matches with the field data type.

Ex: For survey 1 if user want to upload Age, Networth and profession data then user will select 2 Int and 1 varchar field and define the fields as Age, Net worth and Profession

Current table design is as follows:

Field_Name_master:

Id Int
Fk_Survey_Id Int
Field1 Varchar
Field2 Varchar
Field3 Varchar
Field4 Int
Field5 Int
Field6 Int
Field7 DateTime
Field8 DateTime

Fields_Data Table:

FK_Field_Name_Master Int
Field1 Varchar
Field2 Varchar
Field3 Varchar
Field4 Int
Field5 Int
Field6 Int
Field7 DateTime
Field8 DateTime

Can any one suggest the best practice for this type of table design?
Post #524926
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse