Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Importing flat files (e.g.) Excel directly into SQL Database

Tags:
  1. Mar 16, 2016 #1

    WWGD

    User Avatar
    Science Advisor
    Gold Member

    Hi all,
    I have a bunch of legacy files I am trying to import directly into an .sql database. Is there a way of doing this other than by using Microsoft's import/export Wizard?
     
  2. jcsd
  3. Mar 16, 2016 #2

    Borg

    User Avatar
    Science Advisor
    Gold Member

    What do you mean by a bunch? If it's a dozen or so, then use Microsoft's wizard. If it's a lot more than that, I would write a custom program.
     
  4. Mar 16, 2016 #3

    Ibix

    User Avatar
    Science Advisor

    If memory serves BULK INSERT imports files wholesale. No idea what file formats it supports, except I used it for CSV.
     
  5. Mar 16, 2016 #4

    jedishrfu

    Staff: Mentor

  6. Mar 16, 2016 #5

    WWGD

    User Avatar
    Science Advisor
    Gold Member

    Thank you all, does the database schema need to be similar to the flat files for the import to go through?
     
  7. Mar 16, 2016 #6

    WWGD

    User Avatar
    Science Advisor
    Gold Member

    Thanks, what type of program would that be?
     
  8. Mar 16, 2016 #7

    Borg

    User Avatar
    Science Advisor
    Gold Member

    Since I'm a Java programmer, it would be a Java application. Probably no more than a hundred lines of code depending on how complex the differences are between the files and the database.
     
  9. Mar 16, 2016 #8

    jedishrfu

    Staff: Mentor

    It could be Groovy too. Its a lot cooler than Java and all its formalism. Just sayin...
     
  10. Mar 16, 2016 #9

    Borg

    User Avatar
    Science Advisor
    Gold Member

    Like I don't have enough problems at work with the last cool thing that someone decided to use. :cool:
     
  11. Mar 16, 2016 #10

    jedishrfu

    Staff: Mentor

    No really, groovy is something you'd like its java as a scripting language. It has some things in it that you wished java had but doesn't. I've used it to protoype developer tools that used our project libraries but were easily reconfigurable.

    But I digress... so as not to derail the thread in other paths...
     
  12. Mar 16, 2016 #11

    Borg

    User Avatar
    Science Advisor
    Gold Member

    Sounds like it might make a good Insight article. :oldwink:
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Importing flat files (e.g.) Excel directly into SQL Database
  1. Sort by Vs Order by? (Replies: 2)

Loading...