SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Exporting from Excel to SQL

    Hello everyone!
    Please, help me!
    how can I export Excel files to SQL?
    Best regards, Madinak.

  2. #2
    SitePoint Guru asterix's Avatar
    Join Date
    Jun 2003
    Posts
    847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Generally, it works the other way around: you import Excel Files into MSSQL Server.
    In Enterprise Manager, right click on the name of the database.

    Then choose "Import Data"
    Then follow the wizard through the steps.

  3. #3
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First off, what database engine are you using? (MySQL, Oracle, MS SQL, PostgreSQL etc..)

    Secondly, are you trying to get data INTO the database FROM an excel sheet?
    Or is it the other way around?

    Depending on the DBMS you can do both usually.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  4. #4
    Woof! Woof! elel1138's Avatar
    Join Date
    Apr 2004
    Location
    Warsaw, Poland
    Posts
    202
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Export as csv or tab-separated. Most databases have an option of importing such data. You can also write a script in Perl or Python or something.

    Or, there is a trick - hope this will look readable:

    You have:
    Code:
    | John     | Doe      | Havana    |
    | Jack     | Ripper   | London    |
    | Jane     | Austin   | Texas     |
    Insert additional columns and fill them like this (you can easily multiply column text by dragging):

    Code:
    INSERT INTO People VALUES (' | John     | ' | Doe      | ' | Havana    | ');
    INSERT INTO People VALUES (' | Jack     | ' | Ripper   | ' | London    | ');
    INSERT INTO People VALUES (' | Jane     | ' | Austin   | ' | Texas     | ');
    Export as text and voila! You have the database script You will only need to get rid of resulting tabs, but this can be done easily even in Notepad.
    Leszek Leszczyński
    www.hazelsoft.com
    --- Real programmers don't document. If it was hard to write,
    it should be hard to understand. ---


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
  •