Importing Data Into Existing Table

  • Hi,

    I am trying to automatically using a wizard import data from excel into a existing table. (assuming all the fields all are identical in the excel columns compared to sql columns) Any takes?

    Thanks

  • Have you tried anything, yet?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Have you tried the import wizard? It seemed to work well for me, however when building from scratch, excel to sql has given me problems.

  • if the data in Excel is relatively flat, you can use the OLEDB source component and using Jet.

    See http://support.microsoft.com/default.aspx/kb/321686 for an example.

    You can then schedule this package or run it manually.

    However, if the data is more complex in excel, you need something like Data Defractor. See http://www.DataDefractor.com for more info.

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

  • Having the question basically. What I have experienced is that you can use Linked Server functionality under SQL2005, info is on:http://support.microsoft.com/kb/321686;

    Anyway, tried Import wizard, but were ending up with error as I wanted to write my script to query the source file which is Excel and was getting an error.

    If you need to import frequently from the same file setup a linked server following the above instruction(from the MS site).Then you can write a SP to do the business. What I tried until now is the following:

    select * into Names from LS1...Sheet1$ where Lastname = 'Kovac'

    where Names is the target SQL tablename(Names table will be created during the execution),

    LS1-name of the linked server,

    Sheet1-the excel sheet name followed by $.

    I posted this under Import Excel into SQL 2005 today so take a look.

    Cheers

    Ben

  • Thank you all for your sound advice, I was able to solve the problem, I greatly appreciate it.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply