Hi All, I got stuck in a bad situation which is getting worst day by day. I have to export data from sql database to csv file(, delimited and " text qualifier) in UTF8 format. Spent so much time on internet and found a work around.. which involves following steps 1. Create connection to db 2. Use data conversion and convert all DT_STR,DT_TEXT to DT_WSTR,DT_NTEXT 3. Use data conversion and convert all DT_WSTR,DT_NTEXT to DT_STR,DT_TEXT and in codepage select UTF-8 4.Create destination csv file and again in codepage select UTF-8 this is working fine for me but moment there are chinese characters in the data it lost them because of the conversions i use in the package. Is there anyway to convert nvarchar to utf-8 format and store in csv file.. any help would be much appreciated....
MS in their wisdom removed utf-8 support from most things so now SSIS is really the only way to deal with it reliably. Are you sure that you are losing chinese characters rather than having an issue with whatever you are using to view them - in UTF-8 they can be stored in up to 5 bytes per character. I'm a bit surprised you need to go through all that - I'm pretty sure that I've done this by just exporting directly to a UTF-8 file - but my test was to make sure that I could import and export and end up with the same result - may not have had any non-unicode strings. As far as utf-8 is concerned ascii characters aren't affected. I'll see if I can find the packages I used and check.
========================================== Cursors are useful if you don't know sql. SSIS can be used in a similar way. Beer is not cold and it isn't fizzy.
Hi Nigel yes i have to go through this long process... unfortunately couldn't figure out any otehr way around.... i tried to export the csv back into database abd loosing all the chinese characters. any help would be much appreciated.