Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004

    Unanswered: importing data from excel

    I have an excel document that I need to import into a table. The format of the Excel spreadsheet has three columns:

    |First Name | Last Name | Zip code|

    This data is not normalized. I want to convert the data in the spreadsheet to foreign key values for two existing tables.

    The table I'm importing to will contain records with a many-to-many relationship.

    For example,


    imports as:


    Where "Smith" is the first record in the 'rep' table and "77079" is the first record in the 'zip' table.

    How can I bring the data in and then convert the de-normalized data into ID values from my existing tables?

    I have thousands of records that I need to do this for and want to automate the process.

    Thanks for any help.

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    Create a staging table for the import, where you can bring in the "dirty" data from the spreadsheet. Once you've got it there, check to be sure you've got all of the users, and determine how you want to handle any that are AWOL. Do the same with zip codes. After you've got clean data, insert the appropriate rows into your production table, then you probably don't need your staging data anymore so you may decide to delete it.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts