Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

add static footer ssis

Posted on 2014-04-04
3
Medium Priority
?
470 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 37

Accepted Solution

by:
ValentinoV earned 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

610 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