Solved

add static footer ssis

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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

My client sends a request to me that they want me to load data, which will be returned by Web Service APIs, and do some transformation before importing to database. In this article, I will provide an approach to load data with Web Service Task and X…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

746 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

14 Experts available now in Live!

Get 1:1 Help Now