Load data from excel sheet to table

  • Koen Verbeeck (2/5/2012)


    Jeff Moden (2/5/2012)


    As a sidebar, I generally don't import directly from Excel spreadsheets because you can't tell when someone might have it open. I usually tell people to do an export from the spreadsheet to a TAB delimited file.

    And do the people generally listen? 🙂

    Unfortunately, Excel imports are still far too common these days.

    At work, they have to... I'm the one writing the code. 😉

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

  • I usually get the answer: "we've always worked that way. Code around it..." :rolleyes:

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • This was removed by the editor as SPAM

  • Jeff Moden (2/5/2012)


    As a sidebar, I generally don't import directly from Excel spreadsheets because you can't tell when someone might have it open. I usually tell people to do an export from the spreadsheet to a TAB delimited file.

    Most of the Excel sheets we get are dumped in a restricted server folder where the BU can't access them, so I don't have that excuse. And many of these are auto-generated by third party vendors that only do their data exports "one way." @=Pbt

    Feel sorry for me, please. I could use a little sympathy (and some cookies, chocolate chip if you've got 'em.)

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • I have a situation where I can only run scripts in the server.

    So, to import data from excel I just write insert statemens using the concatenation function from excel.

    =CONCATENAR(",(";A2;",'";B2;"','";C2;"','";D2;"','";E2;"','";F2;"','";G2;"','";H2;"','";I2;"','";J2;"','";K2;"','";L2;"','";M2;"','";N2;"');'")

    It ill fil a stag table where I can clean and format the data before updating the production tables.

    It's a easy and safe mode to import small chunks of data when you are not allowed to data bump.

Viewing 5 posts - 16 through 19 (of 19 total)

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