?
Solved

SQL 2005 SSIS Add an unrelated header line to a text file

Posted on 2009-07-15
4
Medium Priority
?
358 Views
Last Modified: 2013-11-10
I need to add an unreleated header line to the top of a text file I'm already extraciting using a SSIS package.

The extracted file needs to look like this:

HDR | MERCHANT REF | MERCHANT NAME | TIME STAMP
1321 | Cushions | CC1234/01| In Stock | £120.00 | Percentage Discount | 50 | etc.
1321 | Cushions | CC1234/01| In Stock | £120.00 | Percentage Discount | 50 | etc.
1321 | Cushions | CC1234/01| In Stock | £120.00 | Percentage Discount | 50 | etc.
1321 | Cushions | CC1234/01| In Stock | £120.00 | Percentage Discount | 50 | etc.
1321 | Cushions | CC1234/01| In Stock | £120.00 | Percentage Discount | 50 | etc.

The header row has a differnet number of columns and different data type from the rest of the extract. So I can't just populate the first row of the source table. So:

1. How do I ammend the SSIS package to write a custom header row to the text file before the rest of the data is written?
2. What expression will give me a time stamp in the final column of the header row?
0
Comment
Question by:Christie_M
[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
  • 3
4 Comments
 
LVL 22

Expert Comment

by:PedroCGD
ID: 24858782
You can add the header after creating the file, correct?
You can use a script task to add an extra row in the header!
Regards,
Pedro
0
 

Author Comment

by:Christie_M
ID: 24858832
Thanks Pedro, there is nothing to stop me adding the header retrospectively. I just don't know how to do that. Do you have an example script that I could use?
0
 
LVL 22

Accepted Solution

by:
PedroCGD earned 2000 total points
ID: 24861404
Take a look to the package I made here and try to customize!
Regards,
Pedro
0
 
LVL 22

Assisted Solution

by:PedroCGD
PedroCGD earned 2000 total points
ID: 24862127
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

752 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