Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2006

    Unanswered: build sql script in excel

    I have been given an excel spreadsheet with two columns with data.
    There are about 20 records in this excel sheet.
    Would like to write an insert query to insert these data.
    I am thinking of writing an insert query for the first line iin the excel sheet and then drag it down to the last row of data so that it automatically writes the values of the columns in the insert query and i just copy and paste the script into sql to run.
    This is what I have but the values of the cells do not get reflected.
    Any thoughts pls?
    'insert into TBLData (RE_ID, EMAIL) values (' & c2 & ',' & d2 ')'

  2. #2
    Join Date
    Feb 2004
    One Flump in One Place
    I used a similar thing just today.

    I wrote the first cell as:
    "INSERT INTO into TBLData (RE_ID, EMAIL) "

    then dragged the following formula down:

    =" SELECT '" & c2 & "', '" & d2 & "' UNION ALL "

    Copy -> Paste to QA and remove the last UNION ALL

    pootle flump
    ur codings are working excelent.

Posting Permissions

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