2

I want to use wine to run a Window's command line program in Linux. This program uses ODBC to connect to an MSSQL server. So far, I have installed MS ODBC driver 17. Now I want to test if the ODBC connection is working.

How do I use sqlcmd to connect to MSSQL via ODBC in Debian 9? I have followed the instructions here to install MS ODBC driver 17

This works.

sqlcmd -S 12.6.01.123 -U SA -P

Here are my configs.

root@633e3d7a58a3:/# odbcinst -j
unixODBC 2.3.4
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

root@633e3d7a58a3:/# cat /etc/odbc.ini
[DB_TEST]
DRIVER=ODBC Driver 17 for SQL Server
UID=SA
PWD=PASSSSSSSSS
DATABASE=DB_TEST
WSID=W1002
APP=Microsoft® Windows® Operating System
SERVER=12.6.01.123
Description=DSA
Jake He
  • 2,417
  • 3
  • 29
  • 41

1 Answers1

0

isql -v DB_TEST SA PASSSSSSSSS

This is the command that I was looking for. ODBC connection is working.

Jake He
  • 2,417
  • 3
  • 29
  • 41