0
votes

I have SQL Server 2016 on Microsoft Windows Server 2012 R2 Standard. When I tried to do BCP export with UTF-8 option, I get this error. Any idea how to solve this? I have read that SQL Server 2014 onward support UTF.

SQLState = S1000, NativeError = 0

Error = [Microsoft][SQL Server Native Client 11.0] This version of SQL Server Native Client does not support UTF-8 encoding (code page 65001)

I used the following command to execute BCP:

bcp "SELECT TOP 10 * FROM MyTable WITH (NOLOCK)" queryout "C:\USERS\Direcotry\TEST\TestData.csv" -t"|" -c -C 65001 -r 0x0A -T -S ServerName
1
According to support, bcp had code page 65001 added in SQL Server 2014 SP (though according to the documentation it was 2016) Either way, if you are using 2016 it will support UTF8. Are you are using 2016? - Larnu
On a different note, Why a TOP without an ORDER BY, and why a NOLOCK (you do understand what NOLOCK does, correct)? - Larnu

1 Answers

0
votes

can you try running the following command?

bcp -v

Verify it is at least a SQL Server 2016 bcp exe version.

I was having the same error and it turned out that our bcp was an exe version from 2012. Also make sure your executing database is in 2016 compatibility mode.