+ Reply to Thread
Results 1 to 8 of 8

Insert cell value to another

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    5

    Insert cell value to another

    Hi
    I've got some data that I need to write into database which is listed in Excel.
    For each row I want to do something like this:
    Let's say we are in 7th row
    INSERT INTO someTable(colA, colB) values(A7, B7) where colC='C7'
    (I want to have it in next cell and then copy it to SQL Management Studio)

    Hope for your help, thanks in advance

  2. #2
    Registered User
    Join Date
    11-20-2012
    Location
    Kolkata
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Insert cell value to another

    there is difference between SQL and Excel. only way u can export the excel file in SQL. if u don't want the data which u have already present in ur SQL then u can match to remove it

    Again sorry to say it is not an SQL forum.

    Moderator is tracking and if they found anything wrong they will inactive ur post.

  3. #3
    Registered User
    Join Date
    01-25-2013
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Insert cell value to another

    I don't fully understand your answer but maybe I also didn't explain properly.
    I just want to put the Query like
    INSERT INTO MATRIX_MODEL_2011 (wynagrodzenie, norma, grupa) VALUES (C7, G7, I7) WHERE Model='A7'
    into cell lets say H7, so generally its hardcoded INSERT INTO MATRIX_MODEL_2011 (wynagrodzenie, norma, grupa) VALUES (, , ) WHERE Model=''
    and just put the text from cells into empty spaces.

    Hope made myself clear

  4. #4
    Registered User
    Join Date
    11-20-2012
    Location
    Kolkata
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Insert cell value to another

    Franakly speaking I didn't get you/ can u please share a sample file with us? where do you want to put the query like Insert Into?

  5. #5
    Registered User
    Join Date
    01-25-2013
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Insert cell value to another

    Ok I'm attaching example worksheet. I want this query to be placed in cell, and then I will copy all queries and run them.

    So, in following query

    INSERT INTO MATRIX_MODEL_2011 (wynagrodzenie, norma, grupa) VALUES (C7, G7, I7) WHERE Model='A7'

    I want to have actual values of cells (C7, G7, I7, A7) in this query,
    like f.e.
    INSERT INTO MATRIX_MODEL_2011 (wynagrodzenie, norma, grupa) VALUES (0,7539, 194, 'A') WHERE Model='001527'
    Attached Files Attached Files
    Last edited by gawkes1; 01-25-2013 at 06:28 AM.

  6. #6
    Registered User
    Join Date
    11-20-2012
    Location
    Kolkata
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Insert cell value to another

    the formula you have shown in excel sheet is an SQL query. Excel does not insert the data in this way (if I am not wrong)

  7. #7
    Registered User
    Join Date
    01-25-2013
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Insert cell value to another

    I just want to create string (don't consider it as a query, just a regular text)

  8. #8
    Registered User
    Join Date
    01-25-2013
    Location
    Poland
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Insert cell value to another

    Just a short comment of course instead of insert into should be update, because currently query makes no sense

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1