Solved

add static footer ssis

Posted on 2014-04-04
3
452 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
A couple of weeks ago, my client requested me to implement a SSIS package that allows them to download their files from a FTP server and archives them. Microsoft SSIS is the powerful tool which allows us to proceed multiple files at same time even w…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now