简体   繁体   English

SSIS 2014-具有不同列数的平面文件目标

[英]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. 我有一个SSIS包(SQL 2014),可将表中的数据加载到平面文件中。 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. 该文件有5列,但是我的数据集中有一行被系统用于重复检查,并且它需要3列而不是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? 我该怎么做?

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. 我做到这一点的唯一方法(我必须编写一个具有不同列数的标头行和页脚行的文件)是将所有内容(所有列)都写到具有单个列的行中,或者编写三个不同的txt。文件,然后使用bat文件将这三个文件合并。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM