DTS package that can read from Excel to determine field names and sizes

  • What I'm looking for is something that can do the following:

    Read from an excel document for field names / lengths and then import a file (or set of files)

    An example of the excel document I get is:

    Field NameStartEndLen.Values
    Address ID11010Numeric
    State Code11122Numeric
    State Abbr.13142Alpha
    Zip Code15195Numeric

    I'm not too concerned about the field type (I generally set them all to default of varchar's anyhow.

    Is there something out there than can recursively read through and do something like this?  Or is it something that I'll want to have custom written?

    Thanks in advance.

  • This was removed by the editor as SPAM

  • How about these steps

    1. Read this excel file (the one you have shown as example above) and store all its rows in a WORK TABLE
    2. Now your WORK table will have the schema for the EXCEL file that you want to import. Say this file is "InputData.xls"
    3. Once the data in the WORK Table is uploaded, execute a SP, that will loop theru eack of the ROWS in this WORK table, dynamically generate the SCHEMA for the TABLE.  You may call the Table name same as EXCEL file name
    4. Now read the "InputData.xls" and insert into SQL Table "InputData". I believe there is a VB code to do this, in http://www.sqldts.com


    paul

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

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