uploading excel document data to a table in sql server 2005.

  • Hi,

    I need to create a page where the client will upload the excel sheet. Once the document is uploaded, I need to read the document to see if the format looks good. Then I have to load the data from excel to a table in the database. I knew that we can upload the documents to a web server and open the file and read its contents. I am looking for a way to upload the contents of file all at once by using a DTS package inside the code. But I am not sure how to do that. If you have any idea please let me know or if you think of some other better way please let me know.

    Thanks,

    sridhar.

  • Gone are the days of DTS. SSIS is here.

     

    It is very easy to create a package to load Excel. See the Excel source adapter in your tool box. Create the source, create the destination.

     

    To execute the package through code, search google - they are many sites showing how.

     

     

    HTH

    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!

  • Unless the worksheet is protected against mistakes like adding an unexpected column or hitting the space-bar to "delete" data, you may get some wildly unexpected results and failures using Excel as a "front-end".  I'd write a little VBS ("Macro on steriods" for the uninitiated )  in the spreadsheet to validate and isolate the correct data and then push the data into the database.

    --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)

Viewing 3 posts - 1 through 2 (of 2 total)

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