Importing multiple Flat Files into Single OLE DB Table destination(all files have different columns for table)

StackOverflow https://stackoverflow.com/questions/18748706

Domanda

I am currently working on creating an SSIS package for a new import files we will received. The company changed how it was before - 1 flat file for 1 table. Now they have there data scatted across multiple files for 1 table.

I have 2 data flow tasks of the 12 that I am fiddling with trying to get to work correctly. --1 has 5 files to 1 db destionation --1 has 3 files to 1 db destination.

Each file does have a consistent key (Property_ID) that I am using for sorting. Current setup of a flat file data flow task is:

  • FlatFile Source1
  • Data Conversion
  • Merge Join1(on sorting ID for other file)
  • FlatFile Source2
  • Data Conversion
  • Merge Join1
  • Sort(sort on propertyID)
  • Merge Join2

  • Flat File Source

  • Data Conversion
  • Merge Join2

  • Merge Join2 -> OLE DB Destination

I have tried all join types for the merge join and am still having problems getting the data into the table correctly.

Each file has different columns for the specified destination table aside from the "Property_ID"

The current results I am receiving are Just rows of data with data from only 1 flat source file and not the others.

Any assistance is greatly appreciated.

UPDATE

I did solve this problem.

What I did was combine 2 files into a merge after each was sorted on a key.

After that, the merge was put into a merge join as the right table where the left join table was the other solo flat source file that would actually have the main sorting key to go into the tables.

The merge join was then sorted on the same sortID all files have been used on directly to the ole db destination.

È stato utile?

Soluzione

What I did was combine 2 files into a merge after each was sorted on a key.

Flat Source DataConversion Sort Merge Join(The left table is the table that has the main id's I want to match)

This goes into a Merge Join that is from the solo Flat Source File; Flat Source DataConversion Sort ToAboveMerge Join

The merge join was then sorted on the same sortID all files have been used on directly to the ole db destination.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top