Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Posts
    1

    Unanswered: Breaking up a string column into multiple records

    Hopefully someone can help me. I have a table of records with the following fields:

    AnswerID (int)
    MultipleChoiceMultipleAnswer (varchar)
    QuestionID (int)

    now the multipleChoiceMultipleAnswer field data is in the following format:

    1234,5678,99867
    2345,456,7891

    I want to break that field up into multiple records using the same AnswerID and QuestionID for each new multiple choice answer, so it would look like this:

    10001 1234 9999
    10001 5678 9999
    10001 99867 9999
    10002 2345 9998
    10002 456 9998
    10002 7891 9998

    Is there an optimized method of doing this without using a cursor to iterate through each record?

    Any help would be greatly appreciated.

    Thanks

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    Look at the following link - if you need something else, let me know -

    link

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •