Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4595718
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:00:42+00:00 2026-05-21T23:00:42+00:00

I’m trying to dump all input0Buffer to a txt file, to end my struggle

  • 0

I’m trying to dump all input0Buffer to a txt file, to end my struggle with making the flat destination re-usable as i’ve over 100 package and each structure and columns are different.

I’m redirecting the error rows to a flat file, so it’s a nightmare to set that manually in every package, so I wanna write the whole input without specifieng Row.Name, all of them into text file.

I’m up to the point that i’m getting only one column!! it’s driving me crazy!!

Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Imports System.IO
Imports System.Reflection
Imports System.Xml
Imports Microsoft.SqlServer.Dts.Pipeline


<Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute()> _
<CLSCompliant(False)> _
Public Class ScriptMain
  Inherits UserComponent

  Dim textWriter As StreamWriter
  Private inputBuffer As PipelineBuffer

  Public Overrides Sub ProcessInput(ByVal InputID As Integer, ByVal Buffer As Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer)
    inputBuffer = Buffer
    MyBase.ProcessInput(InputID, Buffer)
  End Sub

  Public Overrides Sub PreExecute()
    MyBase.PreExecute()
    textWriter = New StreamWriter( "c:\Test4.txt", True)
  End Sub

  Public Overrides Sub PostExecute()
    MyBase.PostExecute()
    textWriter.Close()
    ''
  End Sub

  Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)

    Dim delim As String = ", "

    Dim RowCount As Integer = 0

    For RowCount = 0 To inputBuffer.ColumnCount = -1
      If inputBuffer.Item(RowCount).ToString() = "" Then
        inputBuffer.Item(RowCount) = String.Empty
      End If
    Next

    textWriter.WriteLine(inputBuffer.Item(RowCount).ToString() & delim)

  End Sub

End Class

can anyone help me please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T23:00:42+00:00Added an answer on May 21, 2026 at 11:00 pm

    The issue is where your write is at. You are writing outside of your For loop. You loop through each row and set the value of the entry to String.Empty but you aren’t doing any writing to the textWriter here. Adjust the code as follows:

    Dim myBuilder As New StringBuilder
    
    For RowCount = 0 To inputBuffer.ColumnCount = -1
      If inputBuffer.Item(RowCount).ToString() = "" Then
        inputBuffer.Item(RowCount) = String.Empty
      End If
      myBuilder.Append(inputBuffer.Item(RowCount).ToString() & delim)
    Next
    
    textWriter.WriteLine(myBuilder.ToString)
    

    That will ensure that each column gets written. The only issue will be that your last column will have a delimiter after it. You might want to trim that off before you write it. Also, you will need to add an Imports System.Text to your code as well.

    One note I wanted to add since it can cause some confusion: your loop counter is called RowCount when it is performing the act of counting columns (ColumnCount-1 shows us that). That might cause some confusion down the road and assumptions could be made that might cause coding mistakes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the
I need to clean up various Word 'smart' characters in user input, including but
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.