Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Strange result in DataFlow Script Task

$
0
0

I have a SQL stowed Procedure that is used for a Script Task datasource.

Under SQL Manager when executing the stored procedure there are two records returned when @Licence = 999999.

When running the Script and capturing the output, only 1 record is captured.

    Public Overrides Sub PreExecute()
        MyBase.PreExecute()
        sqlCmd = New SqlCommand("sp_FillADDACS_object_FM", sqlConn)
        sqlCmd.CommandType = CommandType.StoredProcedure
        sqlParam = New SqlParameter("@Licence", SqlDbType.VarChar, 6)
        sqlParam.Direction = ParameterDirection.Input
        sqlParam.Value = Me.Variables.ForEachReportLicnece
        sqlCmd.Parameters.Add(sqlParam)
        sqlReader = sqlCmd.ExecuteReader
    End Sub

   Public Overrides Sub CreateNewOutputRows()
        'Try
        While sqlReader.Read
            BodyBuffer.AddRow()
            Me.BodyBuffer.newcontentlink = sqlReader.GetString(sqlReader.GetOrdinal("contentlink"))
            Me.BodyBuffer.newusernumber = sqlReader.GetString(sqlReader.GetOrdinal("usernumber"))
            Me.BodyBuffer.newrecordtype = sqlReader.GetString(sqlReader.GetOrdinal("recordtype"))
            Me.BodyBuffer.neweffectivedate = sqlReader.GetDateTime(sqlReader.GetOrdinal("effectivedate"))
            Me.BodyBuffer.newreference = sqlReader.GetString(sqlReader.GetOrdinal("reference"))
            Me.BodyBuffer.newpayername = sqlReader.GetString(sqlReader.GetOrdinal("payername"))
            Me.BodyBuffer.newpayeraccountnumber = sqlReader.GetString(sqlReader.GetOrdinal("payeraccountnumber"))
            Me.BodyBuffer.newpayersortcode = sqlReader.GetString(sqlReader.GetOrdinal("payersortcode"))
            Me.BodyBuffer.newreasoncode = sqlReader.GetString(sqlReader.GetOrdinal("reasoncode"))
            Me.BodyBuffer.newpayernewaccountnumber = sqlReader.GetString(sqlReader.GetOrdinal("payernewaccountnumber"))
            Me.BodyBuffer.newpayernewsortcode = sqlReader.GetString(sqlReader.GetOrdinal("payernewsortcode"))
            Me.BodyBuffer.newpayernewpayername = sqlReader.GetString(sqlReader.GetOrdinal("payernewpayername"))
            Me.BodyBuffer.newaosn = sqlReader.GetString(sqlReader.GetOrdinal("aosn"))
            Me.BodyBuffer.newcbiaction = sqlReader.GetString(sqlReader.GetOrdinal("CBIAction"))
        End While
        ' Catch ex As Exception

        ' Finally
        BodyBuffer.SetEndOfRowset()
        '  End Try
    End Sub


Dont ask me .. i dont know


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>