how import flat file with different layout without delimiters to sql server table

  • I have a text file with different layout (RAGGED RIGHT) and I need import to different sql tables (sql2008) using SSIS

    Ex: file.txt

    01JOE KANSAS

    01PAUL DETROIT

    02FIAT

    03NURSE

    03DRIVER

    04100000000

    04200002200

    Table1

    Cod char(2)

    Name (char10)

    City char(10)

    Table2

    Cod char(2)

    Des char(10)

    Table3

    Cod char(2)

    Ocuppation char(15)

    Table4

    Cod char(2)

    Tax1 numeric(5,2)

    Price int

    In my package I input a flat file source importing a text file named file.txt using format ragged right; header row delimiter = {CR}{LF} and create column markers the left 2 characters to output to COD and the rest of line at DES that contains 200 positions.

    After I create conditional split and load it at table 1, table 2, table3 or table4 depending on the cod.

    How method I must use to separate the other fields?

    Sorry, my english is awful...

    Thanks

  • In your data flow task use substring in a Derived Column Transform

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

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