SSIS 需要具有 2 个相同列标题的平面文件输出
我正在尝试使用 SSIS 平面文件目标,但无法想出解决方法来使输出文件具有命名为同一事物的两列。
我要求输出文件具有列标题:
first1, last1, email, shortname, email
每当我尝试映射源数据时,我都会收到错误消息,其中显示“此列名称已存在”和“有多个具有该名称的数据源列” “电子邮件””。
最好的解决办法是什么?
谢谢
I am trying to use SSIS Flat File destination, but cannot come up with a work around for getting the output file to have two columns named to same thing.
I have a requirement for the output file to have the column headers:
first1, last1, email, shortname, email
Whenever I try to map the source data, I get error messages saying things like "This column name already exists" and "There is more than one data source column with the name "email"".
What's the best work around?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设我正确理解问题,您需要在输出文件中有两次相同的列名。不管数据是否相同,只要头部需要重复即可。
这有点做作,但在连接管理器中,取消选中“第一个数据行中的列名称”并将列重新定义为 email 和 email1。这将允许您将列连接到文件中的正确位置。
在平面文件目标中,您可以定义标题行。它非常有限,您不能在其中放置有用的内容,例如动态校验和等,但在您的情况下,粘贴
first1, last1, email, Shortname, email
并运行该包。数据将被提取到正确的列,并且标题行将被添加到包含所有“正确”字段名称的文件中。这种方法有两个缺点。首先,连接管理器仅在尝试从文件中读取标题行时才成为输出。其次,对布局的任何更改都不会与手动标题行保持同步。
Assuming I understand the problem correctly, you need to have the same column name in the output file twice. Doesn't matter whether it's same data or not, just the header needs to be repeated.
It's a little hokey, but in your connection manager, uncheck "Column Names in the first data row" and redefine the columns as email and email1. This will allow you to connect the columns to the right places in the file.
In your flat file destination, you have the ability to define Header row(s). It's very limited, you can't put useful things in there like dynamic checksums and such but in your case, paste in
first1, last1, email, shortname, email
and run the package. Data will be extracted to the correct columns and a header row will be prepended to the file with all the "right" field names.Two downsides to this approach. First is the connection manager becomes output only as it would attempt to read in the header row from the file. Second is that any changes to the layout will not be kept in sync with the manual header row.