SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Database Design


Database Design

Author
Message
JoyKing
JoyKing
Valued Member
Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)

Group: General Forum Members
Points: 68 Visits: 432
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?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search