简体   繁体   English

将SSIS查找的无匹配输出设置为变量

[英]Set No match output from an SSIS lookup to a variable

I need to send an email as an error report for data rows that are either no match or fail due to certain business rules. 我需要发送电子邮件作为错误报告,针对因某些业务规则而导致不匹配或失败的数据行。 I'm having trouble finding a good way to put all of those failed/no match rows into a variable and then send that variable out in an email. 我很难找到一种好的方法来将所有那些失败/不匹配的行放入变量中,然后将该变量发送到电子邮件中。

no match Source component + Lookup transform to the 'matching table', set the 'Specify how to handle rows' combo box to redirect rows to no match output + row count that sets a variable to the number of rows not matching. 不匹配将源组件+查找转换为“匹配表”,设置“指定如何处理行”组合框以将行重定向到不匹配输出+行计数,该行计数将变量设置为不匹配的行数。

Then further down the line, create a Send Email task that has a precedence constraint, expression, of @that_variable > 0 然后再下一行,创建一个优先级表达式为@that_variable> 0的发送电子邮件任务。

fail due to certain business rule Pump data into staging table, then an Execute SQL task to execute a stored procedure that does your business rule validation, and returns a value that is however many rows failed. 由于某些业务规则而失败,将数据泵入登台表,然后执行Execute SQL任务来执行存储过程,该过程将对您的业务规则进行验证,并返回一个值,但是该值导致许多行失败。 Again set the result to a variable, and again a Send Email task that has a precedence constraint, expression, of @that_variable > 0 再次将结果设置为变量,并再次设置优先级表达式为@that_variable> 0的发送电子邮件任务

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

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