SSIS Compilation problems - DirectRowToOutput

205 views Asked by At

Input buffer does not contain a definition for 'DirectRowToOutput0' or likewise for the the other properties below.

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. 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.

New Script tasks appear to be 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.

1

There are 1 answers

1
IdahoB On

"DirectRowToOutputX()" means "Provide support for filtering outputs to named output groups". 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. Now go back and edit your script and the Row.DirectRowToOutput0() statement will work. Code example below.

enter image description here

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
    */
}