RowCount In SSIS to Be flushed out to a flat file ?

  • If I am not wrong, You are trying to get A record count that you write to a flat file and write that cound to another file.

    simply, create a variable and map that to a record count in the recount count transform. bring another dataflow. Inside dataflow use Script transform as source and flat file destination. Write a simple script to write the record count to this flat file. the same can be achieved my doing multicast inside single dataflow.

  • Make sure ur record count is integer variable.

    Inside another dtaflow drag script component. when its ask for something, choose Source. in the input and output tab add a column. in the design script panel .......copy this code and modify acordingly ur need

    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

    Public Overrides Sub CreateNewOutputRows()

    Dim currentDate As Integer

    Dim vars As IDTSVariables90

    'Get the record count

    Me.VariableDispenser.LockOneForRead("CurrentDate", vars)

    currentDate = CType(vars("CurrentDate").Value, Integer)

    vars.Unlock()

    'Output one row with record count

    Output0Buffer.AddRow()

    Output0Buffer.FooterRow = String.Format("H042101522{0}", currentDate)

    Output0Buffer.SetEndOfRowset()

    End Sub

    End Class

    and bring flat file destination to write this.

    email me your ssis packages i will then try to create one for you.

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

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