I'm using MS SQL SERVER 2008 R2 and try to use sqlcmd from command prompt. But getting this error when I try to run sqlcmd with -i command, which is for input file.

This command which is executing simple test.sql(containing only SELECT @@SERVERNAME for test purposes) gives an error:

sqlcmd -S serverName -i test.sql

BUT, this command works well (I just specify command by -q query, instead of reading from file):

sqlcmd -S serverName -q "SELECT @@SERVERNAME"

the error message is:

Sqlcmd: Error: Internal error at ReadText (Reason: No mapping for the Unicode character exists in the target multi-byte code page).

Some issues on google say that this was a known bug and was fixed in SP1, I have installed it but still getting the same problem.

enter image description here

1

There are 1 answers

0
Lev On BEST ANSWER

Changing Computer/VM locale and region to US solved the problem.