Solved

add static footer ssis

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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
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

695 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