4

I have a SLES12-SP5 docker container running and I followed the instructions here : https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15#suse17 to install mssql-tools.

When i try running mssql-tools, I get the following error:

c1dd384365b5:/ # /opt/mssql-tools/bin/sqlcmd
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Driver's SQLAllocHandle on SQL_HANDLE_HENV failed.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Can't initiate unicode conversion.

Is there a setting I am missing?

Pranav Raj
  • 781
  • 1
  • 8
  • 19
  • Broken iconv? Non-ASCII characters in your password? – AlwaysLearning Aug 27 '20 at 09:29
  • 1
    I am not evening reaching to the part where i am entering the SQL Server password. As far as iconv is concerned i have version 2.22 installed on my container.: c1dd384365b5:/ # /usr/bin/iconv --version iconv (GNU libc) 2.22 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Ulrich Drepper. – Pranav Raj Aug 27 '20 at 14:50

2 Answers2

1

You can get this error if the driver does not exist on the deployment machine or there are problems with its installation.

Install/Reinstall the Microsoft ODBC Driver 17 for SQL Server ODBC Driver

Official Microsoft Download link (Windows, Linux, OSX): https://www.microsoft.com/en-us/download/details.aspx?id=56567

Documentation https://learn.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server?view=sql-server-ver15

vvvv4d
  • 3,881
  • 1
  • 14
  • 18
1

Make sure the package glibc-locale is installed. You can also check the output of the locale command.

Before:

LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
...

After:

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
...
Mike
  • 141
  • 1
  • 6