February 4, 2003 at 2:16 pm
I have an ASP page with Questions and Answers that come out of a database.
What would be the easierst way to insert all of this data into a table?
Here is an example of my form.
What color is your home?
(multiple select check boxes)
[]Red
[]Blue
[]Green
Now when someone submits this form they have up to 3 answers.
I want to store each question and answer in a new row, so I cam summarize the data, will I have to do up to 3 insert statements for this one question?
Thanks,
Lance
February 4, 2003 at 2:37 pm
Can the asp page not pass the question number back together with the answer, then you only have to store the answer number/id and the question id?
February 4, 2003 at 2:53 pm
yes, but if the visitor answers Red, Blue and Green and I do not want to put all of that into 1 column
I would put each field into it's own column like this
QuestionID - AnswerID - VisitorID
1 Red 1
1 Blue 1
1 Green 1
February 4, 2003 at 3:03 pm
Sorry I miss the "check boxes" part.
I think I will still try and stick to the normalized idea, in other words insert three records for question xx, a value for each check box.
February 4, 2003 at 3:08 pm
To answer the original question I think a stored procedure! May start looking at XML with a structure similar to question,answer, etc. which get passed to and parsed in a stored procedure.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply