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

  • Hi,

    I have a SSIS package and In the data flow task i have sql block to extract data and this data is getting transfered to a flat file.

    Now i want to use Rowcount component and want to transfer this rowcount to a different flat.

    How can I use rowcount component and get the valur in the flat file, please explain step by step ways of implememtation.

    Thanks RV

  • 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 3 posts - 1 through 2 (of 2 total)

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