ssis and script task

  • I'm trying to edit a ssis package designed by someone that has left us.

    The package basically pull from a text file to a database table.

    But the hard part is it uses a script that is written using c# that uses output buffer to add rows.

    something like below:

    Output0Buffer.AddRow();

    Output0Buffer.PupilNumber = parts[0] == "" ? null : parts[0].Trim();

    Output0Buffer.School = parts[1] == "" ? null : parts[1].Trim();

    Output0Buffer.StatusCode = parts[2] == "" ? null : parts[2].Trim()

    ..........

    now because the source file now added one more field, so I need to change the script to include this new field, so I just add one more line at the bottom, for example:

    Output0Buffer.ModifiedDate = parts[71] == "" ? null : parts[71].Trim();

    But I see an error:

    Out0buffer doesn't contain a definition for ModifiedDate, and no extension method accepting a first argument of type output0buffer could be found...(are you missing a using directive or an assembly reference?)

    I'm not a c# programmer so just tried to guess, there is another bufferwrapper.cs in the solution, I opened it, I see it defined each field there:

    public String EmpNumber

    {

    set

    {

    this[0] = value;

    }

    }

    public bool EmpNumber_IsNull

    {

    set

    {

    if (value)

    {

    SetNull(0);

    }

    else

    {

    throw new InvalidOperationException("IsNull property cannot be set to False. Assign a value to the column instead.");

    }

    }

    }

    so I add the same thing for the new column as above.

    But I see at the top of the class there is a comment that said:

    /* THIS IS AUTO-GENERATED CODE THAT WILL BE OVERWRITTEN! DO NOT EDIT!

    * Microsoft SQL Server Integration Services buffer wrappers

    * This module defines classes for accessing data flow buffers

    * THIS IS AUTO-GENERATED CODE THAT WILL BE OVERWRITTEN! DO NOT EDIT! */

    So if this is an automately generated script, where should I go to add the new column?

    Thanks

  • sounds like you just need to add the an additional output column to the script component to account for the input column (modified date).

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply