检测 SSIS 2005 上的行号
在 SSIS 2005 中,如何检测平面文件的行数?
我碰巧将平面文件导入到 OLE DB 目标,以防出现错误 连续地,我需要识别哪一行导致了错误 “平面文件源错误输出”供以后使用。
我尝试使用控件“派生列”、“导入列”、 “行采样和连接管理器,但没有一个允许我这样做, 我想避免使用“脚本任务”打开文件的替代方案 添加行号并导入数据流任务。
感谢您的帮助!
In SSIS 2005, how can I can detect the number of rows from a flat file?
I happen to be importing a flat file to an OLE DB Destination and in case of error
in a row, I need to recognize which row caused the error from the
"Flat File Source Error Output" for later use.
I tried with the controls "Derived Column", "Import Column",
"Sampling of rows, and the connection manager but none allowed me to do this,
and i would like to avoid the alternative of opening the file with a "Script Task"
add the rownumber and import the data Flow Task.
Thanks for the help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我一直都有这样的情况,我通常想将行号粘贴到我要导入的原始表中,这样我就可以确定哪一行出了问题。
在数据流中,在源目标和目标目标之间添加脚本组件。
在该脚本编辑器中,转到“输入和输出”并在“输出 0”下突出显示输出列,然后选择“添加输出”按钮并将其命名为 count 或 mycount 或 rows...
转到脚本部分并输入
当您转到目的地时,您将看到 mycount 并将其映射到您在表中设置的字段。我想如果您想实时查看数据,您也可以拥有一个数据查看器。
好运
祝安迪
I have this all the time and I usually want to stick the Row numbers into the raw table I'm importing to so I can identify what row is messing up.
In the data flow, add a script component between you source and destination targets.
In that script editor, go to "Inputs and Outputs" and under the "Output 0", highlight the output columns, and select the "Add Output" button and name it count or mycount or rows...
Go to the script section and enter
When you go to your destination target you'll see the mycount and map it to a field you set up in a table. I guess you could also have a Data Viewer if you wanted to see it in real time.
Good luck
Andy