File import into SSIS with columns in different positions each day

0

I have the following situation: I import a Flat File from a * .CSV file into a table in the database. Using SSIS in Visual Studio. However, each day the file I receive has the order of the columns changed. Thus, the "e-mail" field, for example, may end up receiving information from the "telephone". How do I make sure that the import identifies the correct columns regardless of the order?

Exemplo: 
Ordem das colunas no Dia 01: Email, Nome, Telefone
Ordem das colunas no Dia 02: Telefone, Email, Nome
    
asked by anonymous 15.10.2018 / 17:12

1 answer

0

If the order of the columns changes, SSIS maintains the information structure associated with that column. Check out the advanced Flat File Source options

Example Day 01:

Col1, Col2, Col3 A B C AA BB CC

Example Day 02:

Col2, Col1, Col3 B A C BB AA CC

Then you will have to dynamically map the columns through a Script Task because SSIS does not have something predefined for this dynamic mapping.

    
16.10.2018 / 12:30