mercredi 7 septembre 2016

sqlcmd utility not showing greek letters

First of all I am using SQL Server 9.00.4035.00 which is SQL Server 2005 SP3.

I am using the below command to fetch the results from a table which includes columns with either english or greek characters.

sqlcmd -W -S SERVER_NAME -d DATABASE_NAME -U USER_NAME -P PASSWORD -s "|" -Q "set nocount on; set ansi_warnings off;SELECT * from DATABASE.TABLE;" 

This command returns rows with english characters ok, but when it comes to greek characters I only get ??????

For example instead of

1110|20160907|ΓΙΩΡΓΟΣ

I am getting

1110|20160907|????????

I already tried the -f and -u options but none of them seems to work. Here is how I used them:

650001 is for UTF-8 according with this link

sqlcmd -W -S SERVER_NAME -d DATABASE_NAME -U USER_NAME -P PASSWORD -f 65001 -s "|" -Q "set nocount on; set ansi_warnings off;SELECT * from DATABASE.TABLE;" 

1253 is for greek accoring to this book

sqlcmd -W -S SERVER_NAME -d DATABASE_NAME -U USER_NAME -P PASSWORD -f 1253 -s "|" -Q "set nocount on; set ansi_warnings off;SELECT * from DATABASE.TABLE;" 

-u option

sqlcmd -W -S SERVER_NAME -d DATABASE_NAME -U USER_NAME -P PASSWORD -u -s "|" -Q "set nocount on; set ansi_warnings off;SELECT * from DATABASE.TABLE;" 

Aucun commentaire:

Enregistrer un commentaire