简体   繁体   English

SSIS 编译问题——DirectRowToOutput

[英]SSIS Compilation problems - DirectRowToOutput

Input buffer does not contain a definition for 'DirectRowToOutput0' or likewise for the the other properties below.输入缓冲区不包含“DirectRowToOutput0”的定义,也不包含以下其他属性的定义。

Row.DirectRowToOutput0();
Row.ErrorMessage = ex.Message;
Row.DirectRowToFailedValidation();

I had some packages on SSIS package store, and attempted to import them using the Package Import Wizard project.我在 SSIS 包存储上有一些包,并尝试使用包导入向导项目导入它们。 But it had some issues and compilation failed, and completely broke all previous script components so I fished the code out of some backups, and pasted it back into some new script tasks.但是它有一些问题并且编译失败,并且完全破坏了所有以前的脚本组件,所以我从一些备份中提取了代码,并将其粘贴回一些新的脚本任务中。

'ErrorMessage' I did add to a new output flow and column, but it looks like things don't work that way anymore. 'ErrorMessage' 我确实添加到一个新的输出流和列,但看起来事情不再那样工作了。

New Script tasks appear to be C# 2012.新脚本任务似乎是 C# 2012。

What have I missed?我错过了什么? Am struggling to find which documentation I should be using, and these version conflicts are really hard to deal with.我正在努力寻找我应该使用哪些文档,而这些版本冲突真的很难处理。

Using SSDT 2017.使用 SSDT 2017。

"DirectRowToOutputX()" means "Provide support for filtering outputs to named output groups". “DirectRowToOutputX()”的意思是“支持过滤输出到命名的输出组”。 In other words, if you ADD SUPPORT for output filtering, then you get the functionality that you list above.换句话说,如果您为输出过滤添加支持,那么您将获得上面列出的功能。 Here's how:就是这样:

When you configure your Script Component, you need to click Inputs and Outputs, then in the inputs and outputs pane, select the output that you'd like to filter.配置脚本组件时,您需要单击输入和输出,然后在输入和输出窗格中,选择要过滤的输出。 Then in Common Properties, select ExclusionGroup and set it to some value other than zero.然后在 Common Properties 中,选择 ExclusionGroup 并将其设置为非零值。 Now go back and edit your script and the Row.DirectRowToOutput0() statement will work.现在返回并编辑您的脚本,Row.DirectRowToOutput0() 语句将起作用。 Code example below.下面的代码示例。

在此处输入图片说明

public override void Input0_ProcessInputRow(Input0Buffer Row)
{
    bool keepThisRow = ValidateMyRow(Row);

    if (keepThisRow)
    {
        // Get/set Row values, do something useful

        Row.DirectRowToOutput0(); // for Output0
    }
    /* Else do nothing - the row will be filtered OUT of the output if not explicitly
     * included
    */
}

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

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