Groups | Blog | Home
all groups > sql server (alternate) > february 2004 >

sql server (alternate) : Storing and viewing UTF-8 characters...


CJ Butcher
2/13/2004 10:58:05 PM
Hi,

I have a need to pull information from an Oracle 9.2.1 database. It is
storing UTF-8 characters in a varchar2(33) field. I need to be able to pull
these values out and put them in a SQL Server 2000 version of the table with
the UTF-8 characters intact.

Anyone know how to do this...efficiently? I've tried DTS and the high end
UTF-8 characters get lost in the copy.

Thanks,

CJ

Simon Hayes
2/14/2004 11:39:56 AM

[quoted text, click to view]

This KB article may be helpful:

http://support.microsoft.com/default.aspx?scid=kb;en-us;232580

Simon

CJ Butcher
2/16/2004 9:47:23 PM
Thanks for the attempted help Simon.

I've read the article before and am able to get UTF-8 characters into SQL,
the problem is getting them directly from Oracle, seems that DTS converts
the characters to UCS-2 during the transfer...and I don't want it to.

Thanks,

CJ
[quoted text, click to view]

Erland Sommarskog
2/16/2004 11:30:22 PM
CJ Butcher (cj@cjbutcher.com) writes:
[quoted text, click to view]

Storing Unicode data in SQL Server as UTF-8 is probably not a good idea.
There is no collation that understands UTF-8, so if you could get all
sorts of funny surprises when sorting or comparing UTF-8 data. You could
also get nasty surprises with conversion when retrieving or inserting
data, because the client will think that the data is something else
than what it is.

If you really insist of pushing down the squared peg through the round
hole, your best bet is probably to store the data as binary. Then at
least all bits would be in place, but there would still be a lot to lose.

The way to store Unicode data in SQL Server *is* UTF-16.

--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se

Books Online for SQL Server SP3 at
CJ Butcher
2/17/2004 10:11:16 PM
I read that many days ago. It was relatively useless.

CJ
[quoted text, click to view]

AddThis Social Bookmark Button