Click here to Skip to main content
15,891,708 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
iam having examid and questions columns in database
here i have insert 10 questions into single column i.e questions but examid only one time insert with in one button click

i want to insert like this:


examid questions
---------------------------------
1 question1
question2
question3
question4
*
*
*
question10
Posted
Updated 4-Nov-14 1:30am
v4
Comments
DamithSL 4-Nov-14 7:39am    
which programming language are you using, what is the application type? what you have tried so far?
Rajesh waran 4-Nov-14 7:43am    
which application are you using as front end?
Thanks7872 4-Nov-14 8:18am    
As per i understand, you want examid as 1 for all the 10 questions,right?
PhilLenoir 4-Nov-14 9:47am    
Why would you? The correct relational model for this is probably two tables (Exams and Questions, linked on exam ID). You can write a T-SQL function to extract the question in a concatenated format if this is a functional requirement, but it's not a good way to store the data.
Shweta N Mishra 5-Nov-14 4:51am    
You already have the examid column then whats the problem in inserting 1 against the all 10 question. i.e. the way to do that.

1 solution

If they are two columns then you can easily insert, if not then you just add the exam id in the first record by our programming language and then the rest as usual. Other wise you can use stored procedure to do the same work.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900