Solved

add static footer ssis

Posted on 2014-04-04
3
458 Views
Last Modified: 2016-02-10
Experts,

I am Extremely NEW to SSIS (I'm using v2010)

I have a csv file I've exported data into but the consumer of this file requires a footer record. Its just a static piece of text.   "end_of_file"
The csv is set up to put any text value in quotes and the header record is no exception, it needs to be in quotes.

I've been online and attempted many different methods to no avail.

This is the last piece to finish this assignment. Any assistance is greatly appreciated.

Thanks in advance.
0
Comment
Question by:jvoconnell
  • 2
3 Comments
 
LVL 37

Accepted Solution

by:
ValentinoV earned 500 total points
ID: 39985261
You can use a couple of lines of .NET code in a Script Task to achieve that.

In your Control Flow, connect a Script Task with the Data Flow Transformation that creates the flat file.  You'll also need a package variable that contains the name and path of the output file.  Put that variable in the ReadOnlyVariables property of the Script Task.

Then click the Edit Script button and use code similar to this:

string outfile = Dts.Variables["outfile"].Value.ToString();
System.IO.StreamWriter sw = System.IO.File.AppendText(outfile);
sw.Write("\"end_of_file\"");
sw.Close();

Open in new window

This code assumes that the package variable is called "outfile".
0
 
LVL 1

Author Closing Comment

by:jvoconnell
ID: 39986880
Thank you for the help! Very much appreciated.
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39988023
You're welcome!
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lessons learned during ten years of interviewing for SQL Server Integration Services (SSIS) and other Extract-Transform-Load (ETL) contract roles and two years of staff manager interviewing contractors.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question