Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I need dump table from SQL Server to csv in utf-8

This works but not in utf-8:

sqlcmd -S Server -d DB -E -s, -W -i "C:\Localdata\test.sql" | findstr /V /C:"-" /B > "C:\Localdata\Test.csv"

Would anybody like to help fix this into utf-8?

like image 597
JoezCodes 101 Avatar asked Jan 05 '23 19:01

JoezCodes 101


1 Answers

add -f 65001 to the sqlcmd command. (or -f o:65001 if you want UTF-8 output, -f i:65001 for UTF-8 input)

like image 149
denbrice Avatar answered Jan 08 '23 07:01

denbrice