cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to Connect to MS SQL Server 2012 from RedHat Linux using ODBC

0 Kudos

Hi Experts ,

I am trying to connect from my HANA box to MS SQL server 2012 using unixODBC and MS SQL SERVER Drivers getting message

"

[unixODBC][Driver Manager]Data source name not found, and no default driver specified

[ISQL]ERROR: Could not SQLDriverConnect

"

when I run isql -v SGF user passowrd

I am able to connect from another HANA database , so my unixODBC is working .

below is the odbc.ini file

[SGF]

  Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-11.0.so.2270.0

  Server=myserver.com,1433

  Database=SGF

Accepted Solutions (0)

Answers (6)

Answers (6)

0 Kudos

I am able to connect to the database using sqlcmd

sqlcmd -S servername.com,1433 -d <database> -U username -P password

The above command works and able to query the database

0 Kudos

I tried the same steps still not working

0 Kudos

I tried placing the odbc.ini file in home directory of sidadm it did not work , any other suggestions please

Former Member
0 Kudos

Are you following the similar steps in the below blog ? This has been tested in multiple environment and worked fine.

Configuring Remote Source connection (SDA) from HANA to MSSQL

Your DNS name in odbc.ini should match the drive name that you are creating in HANA studio.

henrique_pinto
Active Contributor
0 Kudos

Place the .odbc.ini file in the home directory for the <sid>adm user (that's the user HANA uses to connect to linux and get the unixODBC details).

Former Member
0 Kudos

Hi Sriram,

Your DNS is not identifying properly. You need to keep your .obc.ini file in Home directory.

creating the .odbc.ini file and setting up the configuration:

As HANA requires the .odbc.ini file for communicating with remote source MSSQL. Hence, we need to create .odbc.ini file in $HOME directory.

1. Login with sidadm user and create .odbc.ini file -> vi .odbc.ini file

2. Create DSN as MSSQL

3. Server=nave of the server you want to connect and port number

4. Driver = Location of the ODBCsql driver.

P.S: your .odbc.ini file should look like above

5. Goto Home directory and open .sapenv.sh file and add the below line (Update the LD_LIBRARY_PATH)

    export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/microsoft/msodbcsql/lib64

6. Restart SAP HANA

Have you checked the blog

Regards,

Pavan Gunda

0 Kudos

Hi ,

I tried that , it did not work , then I changed the env variables to point to /etc/odbc.ini

below is odbcinst -j putput as sidadm

odbcinst -j

unixODBC 2.3.0

DRIVERS............: /etc/odbcinst.ini

SYSTEM DATA SOURCES: /etc/odbc.ini

FILE DATA SOURCES..: /etc/ODBCDataSources

USER DATA SOURCES..: /etc/odbc.ini

SQLULEN Size.......: 8

SQLLEN Size........: 8

SQLSETPOSIROW Size.: 8

former_member182967
Active Contributor
0 Kudos

Hi Sriram,

Have you already installed the SQL Server ODBC driver and made test connection to remote SQL Server as per note 1644499 - Database connectivity from Linux to SQL Server?

Regards,

Ning