Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

SSIS: Process Flat Files having different number of columns

$
0
0

Hi, 

I have 4 .csv files in a folder which I want to load in different SQL tables:

A_timestamp : 100 columns

A_timestamp: 50 columns

B_timestamp: 80 columns

B_timestamp: 30 columns

So I want my package to read all 4 files from the folder and insert them into the respective tables. The issue here is that the name of files is suffixed by timestamp so upon seeing a file we don't know how many columns it has. The approach I am trying is as follows:

1. Use a foreach container to loop through all files

2. Inside Foreach loop container, use a script task to count the number of columns.

3. Based on the number of columns, use precendence constraints to redirect the file data to the respective DFT (I have 4 DFT connected to script task)

Issue: How can I pass the connection info to script task dynamically so it can read files with different number of columns?.


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>