Problem with SSIS Script Component being able to recognize when the last rowset is being processed

  • I'm using the following code in the script component. The first two MsgBox's display during execution. The third MsgBox does not display. When the last record is processed and the MsgBox is displayed by the second MsgBox, Row.EndOfRowset is still False. According to everything I'vwe read it should be True. What have I not done? What do I need to do. I need to do some special processing after the last record have been processed.

    Imports System

    Imports System.Data

    Imports System.Math

    Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper

    Imports Microsoft.SqlServer.Dts.Runtime.Wrapper

    Public Class ScriptMain

    Inherits UserComponent

    Dim i As Integer

    Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)

    i = i + 1

    If i < 3 Then
    MsgBox("Provider.id = " & Row.PROVIDERID & vbCrLf & _
    "Record number = " & i & vbCrLf & _
    "Seq No = " & Row.EXP837SEQNO)
    End If

    If i > 118 Then

    MsgBox("Provider.id = " & Row.PROVIDERID & vbCrLf & _

    "Record number = " & i & vbCrLf & _

    "Seq No = " & Row.EXP837SEQNO)

    End If

    Me.Output0Buffer.AddRow()

    Me.Output0Buffer.newFile = Row.PROVIDERID & Row.EXP837SEQNO

    If Row.EndOfRowset Then

    MsgBox("end of rowset encountered")

    End If

    '

    End Sub

    Public Overrides Sub CreateNewOutputRows()

    '

    ' Add rows by calling AddRow method on member variable called "Buffer"

    ' E.g., MyOutputBuffer.AddRow() if your output was named "My Output"

    '

    End Sub

  • I'm not claiming expertise here, but maybe my questions can help.

    Why do you expect Row.EndOfRowset to be true? If the looping is outside the script and the script only gets run for each row in the resultset, it wouldn't get executed once the Row.EndOfRowset condition is reached, right?

    If you still haven't figured out what's going on, you may want note that you're moving your question and re-post it in the SSIS forum.

    ====================

    Double posted -- discussion continues in SQL 2005 SSIS Forum.

    ----------

    edit: Original response referred to "EOF" as in End of File. Changed to Row.EndOfRowset.

    Also added note about this now being in the SSIS forum (just saw it there, so will re-post reply there so others may see and comment).

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

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