November 22, 2013 at 3:12 pm
i have a csv file like this
example:
ques_1 ques_2a ques_3 ques_4...
4 5 28 27
i have two tables survey,surveyanswers
right now im populating data from csv file into survey table like this but i want to insert answers for each id in survey table insted of id numbers how is this possible.
survey table : columns
s_id ques1 ques2a ques3 ques4
1 1 4 6 7
-------------------------------------------------------
surveyanswers table with columns and values
id ques answers
1 1 yes
2 1 no
3 1 2
4 2 5
5 2 2
6 3 1
7 4 1
...38
In surveyanswers table i have 38 id's column is identity ,for id =1----ques_1 id=2-------ques_1 id=3----------ques_1,id=2---------ques_2
I want to insert ansers for question id's in survey table
November 25, 2013 at 7:40 am
There is nowhere near enough information for much more than a wild guess. You need to provide a lot more details about the source file, the target tables and the logic you are trying to use here. You really have only provided about a third of the information required for anybody to have much chance of helping.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply