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

No records written to flat file by Script component.

$
0
0

Hi All.

Am writing a result set to a flat file in SSIS. My data source is stored procedure. The requirement is to write Header data without the header columns and append detail data to the same file without detail columns names as well.

My code is not writing any data to file despite been visible in data viewer.

Please help. My code is as below.

using System;
using System.IO;
using System.Data;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;

[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent   

{
    string headerfile;
    StreamWriter tw;
    string columnDelimiter = ",";


    public override void AcquireConnections(object Transaction)
    {

        IDTSConnectionManager100 connMgr = this.Connections.FFDESTConn;
        headerfile = (string)connMgr.AcquireConnection(null);

    }
    public override void PreExecute()
    {
        base.PreExecute();
        tw = new StreamWriter(headerfile, false);
        /*
         * Add your code here
         */
    }

    public override void PostExecute()
    {
        base.PostExecute();
        tw.Close();
        /*
         * Add your code here
         */
    }

    public override void Input0_ProcessInputRow(Input0Buffer Row)
    {
        /*
         * Add your code here
         */
    }

}


Viewing all articles
Browse latest Browse all 24688

Trending Articles



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