Pops
Pops

Reputation: 498

SSIS 2014 - Flat File Destination with Different Number of Columns

I've got an SSIS package (SQL 2014) that loads data from a table into a flat file. The file has 5 columns, however there is one row in my dataset that is used by the system for duplicate checking, and its required to have 3 columns, instead of 5.

How my file looks like now:
ID|Desc|UDF1|UDF2|UDF3
DUPECHECK|SaysSomethingIrellevant|||
ID1|Desc1|||
ID2|Desc2|||

How I want my file to look:
ID|Desc|UDF1|UDF2|UDF3
DUPECHECK|SaysSomethingIrellevant|
ID1|Desc1|||
ID2|Desc2|||

You can see how the second row of the file should have a different number of columns than the rest of the rows. How am I able to do this?

Upvotes: 1

Views: 754

Answers (1)

benjamin moskovits
benjamin moskovits

Reputation: 5458

You cannot do it. The only way I did it(I had to write a file with a header row and footer row which had different number of columns) is to either write everything (all the columns) to a row with a single column or to write three different txt files and then combine the the three file using a bat file.

Upvotes: 2

Related Questions