错误输出和“无匹配输出"有什么区别?在查找转换 SSIS [英] What´s the difference between Error output and "No match Output" in Lookup transformation SSIS

查看:31
本文介绍了错误输出和“无匹配输出"有什么区别?在查找转换 SSIS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 SSIS 中使用查找转换并将其连接到两个平面文件目标.我知道转换有两个绿色输出,但我不能使用红色错误输出而不是无匹配输出"和重定向行"吗?有什么区别?

I want to use a lookup transformation in SSIS and connect it to two flat file destinations. I know there are the two green outputs from the transformation but couldn´t i use the red error output instead of "No match output" and "Redirect row" instead? What´s the difference?

推荐答案

通过 SSIS 中的查找转换,您可以控制处理不匹配"情况的方式.双击您的查找转换,然后在常规"选项卡上,您可以通过选择以下选项之一来选择如何处理不匹配的行:

With the Lookup Transformation in SSIS, you have control over how you want to handle "No Match" situations. Double-click your Lookup Transformation and on the "General" tab you can select how to handle non-matching rows, by selecting one of the following options:

  • 忽略失败:继续处理,好像什么也没发生
  • 失败组件:抛出异常并停止处理数据流任务
  • 将行重定向到错误输出:不是跟随绿色输出,而是将行移动到红色输出以单独处理.
  • 将行重定向到不匹配的输出:将行切换到辅助输出,允许您以与匹配数据不同的方式处理不匹配数据.

如果您右键单击您的查找并选择显示高级编辑器",您可以看到更多细节.跳转到输入和输出属性"窗格,您可以看到查找无匹配输出"和查找错误输出"流之间的区别.

If you right-click your Lookup and select "Show Advanced Editor", you can see a bit more detail. Jump over to the "Input and Output Properties" pane and you can see the difference between your "Lookup No Match Output" and "Lookup Error Output" streams.

查找错误输出"是一个标准且不可编辑的输出流,它捕获错误并将错误详细信息添加到现有列集合中,允许您处理错误、记录错误、跟踪导致错误的行等.

The "Lookup Error Output" is a standard and non-editable output stream that catches the error and adds error details to the existing column collection, allowing you to handle the error, log it, track the row that caused it, etc.

查找无匹配输出"允许您定义自己的列以传递到不同的输出流和/或对不匹配的行进行一些不同的处理.一个很好的例子是使用查找转换"来查看在处理时是否需要向数据库中的查找表添加新行.不匹配的行可以重定向到无匹配输出",分组以删除重复项,然后插入到数据库中,而其余行继续向前.

The "Lookup No Match Output" allows you to define your own columns to pass to a different output stream and/or do some different processing to rows that fail to match. A good example of this is using a "Lookup Transformation" to see whether you need to add new rows to a lookup table in the database while processing. Rows that don't match could be redirected to the "No Match Output", grouped to remove duplicates, and inserted to the database, while the rest of the rows continue onwards.

归根结底,这取决于您要尝试做什么.如果您想处理错误(即截断,与处理不匹配行的方式不同,那么您可以使用查找无匹配输出"来执行此操作.

Bottom line, it depends what you're trying to do. If you want to handle errors (i.e. truncation, differently to how you would handle non-matching rows, then you can use the "Lookup No Match Output" to do so.

就我个人而言,我更愿意使用匹配/不匹配输出来处理已知条件,并保存错误输出"以进行实际的意外异常处理.

Personally, I would rather handle the known condition using Match/No-Match outputs and save the "Error Output" for actual unexpected exception handling.

这篇关于错误输出和“无匹配输出"有什么区别?在查找转换 SSIS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆