I'm trying to export data from SQL Server using BCP utility on cmd into a .txt file.
My requirement is that the exported .txt file needs to be in UTF-8 encoding, but whatever I do it always comes out as 1252 ANSI.
I'm running SQL Server 2017, BCP utility version is 14. My code is as follows:
bcp "Select top 1000 * from MyTable" queryout "C:\ETL\Accuracy_A3.txt" -c -C 65001 -T -S "MYMSSQLSERVER" -d "MyWorkDB"
The code works and doesn't give me any errors, but the resulting file is still in 1252. I've tried to convert it to other code pages, but it's till in 1252, so I believe that I'm calling the switch wrong or something. I've also tried to pull out a whole table instead of queryout
and it doesn't make a difference.