none
SQL insert with multiple records

    Question

  • queryStr = "INSERT INTO tbl_user_ldr_responses (rec_num, ques_no, response, comment) " & _
        recnum & ", " & "1, " & "'', " & reader.GetValue(1) & " UNION ALL" & _
        recnum & ", " & "2, " & "'" & reader.GetValue(2) & "', " & "''"

    How can I fix my string so that it will resemble the below SQL code to insert multiple records with one insert command?

    INSERT INTO thetable (field1, field2)
    SELECT value1, value2
    UNION ALL
    SELECT value3, value4
    UNION ALL
    .
    .
    .
    SELECT value5, value6;


    -Nothing to see. Move along.

    Friday, May 11, 2012 6:11 PM

Answers

All replies