views:

39

answers:

1

I have some utf8 data which I would like to bulk insert (sql server 2005). I am using the CODEPAGE 65001:

BULK INSERT #bla
FROM 'D:\bla.txt'  
WITH 
( 
    CODEPAGE=65001,
    FIELDTERMINATOR = '\t', 
    ROWTERMINATOR = '\n'
)

Unfortunatly strings like this:

Erdağı

end up being stored like this:

Erda??

Do I use the wrong code page? Is there anything else I can do?

Thanks.

Christian

+1  A: 

According to this link, "SQL Server does not support code page 65001 (UTF-8 encoding)." At first, I thought this related only to 2008, but according to a Microsoft technical writer's response to a question on this link, "SQL Server never has supported code page 65001 (UTF-8 encoding)."

Joe Stefanelli
Interesting and very disappointing. I originally obtained the code page from one of these sites – they must have changed something. Are you aware of a work around?
csetzkorn
Sorry, but I'm not aware of a work around.
Joe Stefanelli
It seems to like UCS-2 and you can translate UTF8 to UCS-2. Has anyone done this succesfully?
csetzkorn
I have managed to translate UTF8 to UCS-2 (there may be some information loss though). Note that you should use nvarchar whilst importing as well.
csetzkorn