Adding Trailer Record to end of a file
Hello Everyone, I have an SSIS package which takes a SQL Query and generates a PIPE (|) delimited flat file. Simple enough. However, I also need to add a Trailer record at the bottom of the file (footer). To make this happen I could either do a UNION ALL on the same query script or what I've done is to create another query with the Trailer record and using the Merge component simply merged and appended the trailer record at the botton of the actual file. The issue, however, is that the trailer record is always including extra PIPES at the end of the trailer. According to business, this wouldn't load properly at our vendor side due to the extra pipes in the trailer record as it'll be seen as additional columns. Is there anyway to get rid of those extra pipes at the end of the trailer? Please see example below. Trailer record should look like this: TRAILER|A|B|C|D| As of now, the appended Trailer record looks like this (additional pipes for each column in the main query script): TRAILER|A|B|C|D||||||||||||||||| Thank you all in advance for your insight. MirS
April 27th, 2011 11:00am

I would do this: once the file is written (w/o the trailer row at this point in time), manipulate on it by using a Script Task (a normal FileSystem call to append to it) to add the needed trailer.Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
April 27th, 2011 11:16am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics