SSIS 平面文件源 - 添加行列
在我的平面文件源中,我将所有列映射到具有正确类型的输出列。
检索数据后,我检查文件中包含的引用是否存在于数据库中,如果不存在,我必须记录该行并写入哪个值未找到匹配项。
因此,为了记录该行,我希望顶部有一列包含完整的原始行,就像错误输出“平面文件源错误输出列”一样。
所以我的问题是:有没有办法向我的平面文件源添加一列,该列将包含完整的行,而不需要在数据中进行格式化?
In my Flat File source, i have all the columns mapped to output columns with the right type and all.
After retriving the data, i check if the reference contained in the file exists in the database, if they don't, i have to log the line and write which value did not find a match.
So, in order to log the line, I would like top have a column containing the complete original line, just like the error output "Flat File Source Error Output Column".
So my question is: Is there a way to add a column to my Flat File Source, that would contain the complete line, without formatting in the data?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将使用派生列任务并通过连接文本文件中的所有列来指定要添加的新列。
例如,如果您的文本文件具有以下结构:
Col1, Col2, Col3, Col4, Col5
您的派生列将指定以下表达式:
[Col1] + [Col2] + [Col3] + [Col4] + [Col5]
您如果您想分隔列,可以选择添加分隔符。
这将返回一个附加列,用于后续数据流任务。
I would use a Derived Column Task and specify a new column to be added by concatenating all the columns from the text file.
For example, if your text file has the following structure:
Col1, Col2, Col3, Col4, Col5
Your derived column would specify the following Expression:
[Col1] + [Col2] + [Col3] + [Col4] + [Col5]
You could optionally add a delimiter if you wanted to break apart the columns.
This would return an addition column to be used in subsequent data flow tasks.