Script task as Source in data flow

  • in what case/situation may i want to use Scripting task as source in data flow?
    Why/when is it better than the other sources ?

    Likes to play Chess

  • VoldemarG - Wednesday, November 14, 2018 8:19 AM

    in what case/situation may i want to use Scripting task as source in data flow?
    Why/when is it better than the other sources ?

    You would use a Script Component (not a task, that isn't the same) when one of the supplied Source Components can't be used; for example your data doesn't confirm to normal formats, or it's from a source that isn't part of those available.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • I've used it for parsing few similar but with own specifics fixed length text files.

    There was a header with important note and summary fields that needed checking against the data.
    So with the script task I read the file only once: 
    Read the header, get the notes, check some asserts and read summary data.
    Then a loop with ReadLine from StreamReader and parsing the line.
    There were specifics in dates and money amount representations so I've wrote generic parsing helper functions for the different types.
    At the end check if the summary data from the header matches calculated summaries during data reading.
    The only ugly part is that in the DataBuffer for each field there is different property Field_IsNull that needs to be set when you need to pass null as result and this breaks the encapsulation.

  • VoldemarG - Wednesday, November 14, 2018 8:19 AM

    in what case/situation may i want to use Scripting task as source in data flow?
    Why/when is it better than the other sources ?

    I've used it when getting data from web services (eg, Google Analytics). As Thom mentioned, it's a Script Component, not a Script Task.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

Viewing 4 posts - 1 through 3 (of 3 total)

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