Can I call DirectRowTo<outputbuffer> multiple times in a script component?

  • I am parsing an input flat file, and want to direct it to multiple tables. Each row of the input file could correspond to 1-N rows in one of the destination tables.

    I'm using a script component to parse things, and it's working, sort of. What I'm doing is parsing my input, setting my output, and then calling DirectRowToMyBuffer.

    I then parse through the set of columns that can hold multiple rows of data; if I find data, I set my output vars to the new data, and then call DirectRowToMyBuffer again. I'm getting duplicate data; it's almost looking like it's not exporting the data procedurally, but instead at the very end after it has the latest data I've set the output vars to. I'm trying to figure out what it's doing, but if I can't even do what I'm aiming for I'll have to try something else.

    Thanks for any info!

  • Pete T-366679 (10/22/2009)


    I am parsing an input flat file, and want to direct it to multiple tables. Each row of the input file could correspond to 1-N rows in one of the destination tables.

    I'm using a script component to parse things, and it's working, sort of. What I'm doing is parsing my input, setting my output, and then calling DirectRowToMyBuffer.

    I then parse through the set of columns that can hold multiple rows of data; if I find data, I set my output vars to the new data, and then call DirectRowToMyBuffer again. I'm getting duplicate data; it's almost looking like it's not exporting the data procedurally, but instead at the very end after it has the latest data I've set the output vars to. I'm trying to figure out what it's doing, but if I can't even do what I'm aiming for I'll have to try something else.

    Thanks for any info!

    Hi Pete,

    You have to use asynchronous outputs, which doesn't depend on the input row. And then you can call AddRow -> Set Fields -> AddRow ... multiple times for the current input row.

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • Interesting - and I'm assuming that would be faster than building/calling appropriate stored procedures for each "output" I want? I ended up deleting off my outputs, and essentially handling all of the logic and adding to the database via stored procs called in the script component. It seems to be a great deal slower than when directtooutput was used.

    Thanks, I'll look into this!

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

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