Create UTF-8 Flat File in SSIS
Hi,
I have an issue while generating a flat file in UTF-8 format in SSIS
These are some steps which i already tried
1. Cast the VARCHAR to NVARCHAR in the source SQL query.
2. Set the DefaultCodePage= 65001 in the advance Editor of the Source DB control
3. Set the Code Page property to 65001(UTF-8) in the Flat File connection Manager Editor.
but all the above didn’t work. So tried down the 4th step
4. Created a flat file in UTF-8 format in the script task with C#, and used this as a connectionString in the Flat File connection Manager, and populate data to the Flat Files.
but this too didn’t helped me out, the file encoding was converted into ASCII not UTF-8. :(
Any reasons why the file format is changing even though all the properties are set properly to get the output in the UTF-8 encoded text format? or, am i missing any settings.
However, i tried one more option, not set the property of "overwrite the data" in FLAT File Destination control. this gave me Flat file with UTF-8 but the file contains the data
which was inserted in step - 4. I don’t want any dummy data in the Final Text file generated.
Advance many more thanks for your Help!
:Loknath
July 22nd, 2011 7:37am
you should go to advanced editor, and change column data type from DT_STR to
DT_WSTR also.http://www.rad.pasfu.com
My Submitted sessions at sqlbits.com
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2011 7:45am
Thank you, Reza!
Yes, i have done these changes too.
I even tried by converting VARCHAR columns to NVARCHAR, but no luck.Loknath Vendra
July 22nd, 2011 7:51am
I think you did something wrong, could you take some screen shots of your package and put here from different options and advanced editors configurations you made.http://www.rad.pasfu.com
My Submitted sessions at sqlbits.com
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2011 8:15am
I don't know how to put an image here.
but there are few properties which were editable in Advance editor, which i set them as below
In OLEDBb Source
Under Component Properties
AlwaysUsedefaultCodePage = false (tried with True also)
DefaultCodePage = 65001
Under Input and Output Properties
Data Type= Unicode string [DT_WSTR] (in both Extenal columns and Output Columns)
Length = 30
In Flat File Connection Manager
set Code Page = 65001 (UTF-8)
the Files are delimited one, columns by tab and rows by {CR}{LF}Loknath Vendra
July 22nd, 2011 8:42am
there is also an ADVANCED tab in FLAT FILE CONNECTION MANAGER EDITOR, you should set column data type there as DT_WSTR alsohttp://www.rad.pasfu.com
My Submitted sessions at sqlbits.com
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2011 8:45am
Yep, those properties too were changed, but my bad!
but i am still not understanding why SSIS is changing the file format while writing.Loknath Vendra
July 22nd, 2011 9:02am
Hi Loknath,
Have you found the solution of this issue? I also got the same problem.
Thanks
Free Windows Admin Tool Kit Click here and download it now
August 23rd, 2011 11:31pm