Removing Trailer Record from a text file!
Hi I need to remove the last record from a text file? What's the easiest approach to do this using SQL Server Integration Services? Thanks.
October 14th, 2008 3:58pm

You don't say what the last record looks like. Is it different then the rest of the records or does it have some indicator that means it is the last record, other? Without knowing how to detect the last record it is hard to say how to remove it. Some possible options: 1. If it is different then the rest of the records you possibly can configure the error output to get this record if it is enough different that the parsing fails. 2. If you can detect the row in some manner you could use conditional split to filter it out. 3. For other you would have to say how it can be detected. Matt
Free Windows Admin Tool Kit Click here and download it now
October 14th, 2008 5:10pm

A couple of generic options for doing this: Use a script to preprocess the file and remove the last row. Import the flat file into a table (perhaps as a single string column) and delete the last row. As Matt said, without more detail, it's tough to say what would work best.
October 14th, 2008 5:55pm

Hi Matt In my case, the last row can be identified through a pattern, so I simply used the conditional split to filter it out. Thanks again, Salman Shehbaz,
Free Windows Admin Tool Kit Click here and download it now
October 17th, 2008 6:25pm

It all depends on whether you can distinguish the trailer record from the other records. Here are a couple of solutions if you can't. Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
February 27th, 2011 3:13pm

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

Other recent topics Other recent topics