Christie_M
asked on
SQL 2005 SSIS Add an unrelated header line to a text file
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?
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?
ASKER
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use a script task to add an extra row in the header!
Regards,
Pedro