June 11, 2009 at 6:47 pm
I generate a comma separated file with {cr}{lf} for the rows. At the end of the last row it adds another line. How can I remove the last {cr}{lf}?
Thanks
Bob
June 11, 2009 at 7:51 pm
declare @CRLF = char(13) + char(10)
set @YourString = replace(@YourString, @CRLF + @CRLF, @CRLF)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 11, 2009 at 8:19 pm
I appreciate your response. However I'm not sure I understand or maybe I'm not being clear. It is the text file that I'm generating that has the extra line at the end I want to remove. The carriage returns/line feeds are created in the flat file connection manager by design. It just adds one to many.
Thanks
Bob
June 11, 2009 at 9:19 pm
Whoops, I didn't notice that you were in the SSIS forum - I gave you a T-SQL solution.
I'll have to let someone that knows SSIS better answer this.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply