Hi
Thanks for your response. It works perfectly now.
We can't do anything about the format of the original file, but it does get initially imported to an SQL table before being exported to the the text file in the example. I have added an execute SQL task to the package to replace the nulls in the table before it is exported to text.
Main Topics
Browse All Topics





by: stelth240Posted on 2009-10-20 at 12:17:11ID: 25617415
The normal way to replace a value is to user REPLACE() but I don't know that you'd be able to enter that null value into the function correctly. What's causing the null characters to be in the string in the first place? In the first sentence you said "...screen shot showing the nulls in the text file... When exporting this (the text file in the screen shot?) to a flat file text file (another text file?)..." Does that mean you are going from a text file to another text file, or is the source coming from somewhere else?
I'm asking this because if the data is originally stored in SQL Server, you can use this to remove the null characters:
REPLACE(DataColumn, CHAR(0), ' ')
You would do that in the source component or in the stored procedure or view called in the source component.
If the data is originally text, you can store it temorarily into a table in SQL and then do the same replace. I'm not sure of a way to remove them in SSIS since there is no CHAR() function that I'm aware of.