views:

916

answers:

2

A colleague tells me that there is no way to bulk insert UTF-8 encoded data into a Microsoft SQL server 2008.

Can this be true? Is there any stuff you would recommend him to read or look at?

+2  A: 

UTF-8 isn't a part of SQL Server's Unicode strategy (unfortunately). However, UTF-8 is well supported in .NET. If you are willing to write .NET code, you could use the System.Data.SqlClient.SqlBulkCopy class in conjunction with a System.IO.StreamReader and/or `System.Text.Encoding.UTF8'.

Another option is Integration Services. For file connections, you can choose code page 65001 (UTF-8).

binarycoder
Actually, there is no .NET used here. It's a windows development enviroment running Cold Fusion on the server with a MS SQL server 2008 backend. All tools have to understand the encoding chosen. Right now, the chosen encoding is ISO-8859-1 (latin 1).
Jesper Rønn-Jensen
<Actually, there is no .NET used here> See the part about using Integration Services. Alternatively, if you are into Powershell, you could call all the needed .NET things from there.
binarycoder
A: 

It is true. The documentation for BULK INSERT says 'SQL Server [2008] does not support code page 65001 (UTF-8 encoding)'.

There is also a Connect Page for this issue, although the issue is now closed.

Robert Claypool