4
$\begingroup$

We have a data lake in here that uses MS SQL Server 12.02 and connects using the active directory integrated services authentication.

The standard driver would not work

<< "DatabaseLink`"
 
sqlStandard = 
  SQLConnection[
   JDBC["Microsoft SQL Server(jTDS)", 
    "jdbc:sqlserver://myserver;DatabaseName=db;authentication=ActiveDirectoryIntegrated"], 
   "Name" -> "DataLake", "Catalog" -> Automatic,"Description" -> None, "ReadOnly" -> Automatic, 
   "RelativePath" -> False, "TransactionIsolationLevel" -> Automatic,"UseConnectionPool" -> Automatic];


connStandard = OpenSQLConnection[sqlStandard]

(*JDBC::error: The syntax of the connection URL 'jdbc:jtds:sqlserver://myserver;DatabaseName=dw-scv-prod;authentication=ActiveDirectoryIntegrated' is invalid.*) 
$\endgroup$
5
$\begingroup$

I downloaded the MS SQL driver from Microsoft

https://docs.microsoft.com/en-us/sql/connect/jdbc/microsoft-jdbc-driver-for-sql-server?view=sql-server-ver15

and installed it under C:\Users\myuser\AppData\Roaming\Mathematica\Applications\Oracle\Java

also placed the following dll driver in

mssql-jdbc_auth-9.2.1.x64.dll

in the same directory.

sqlMS = SQLConnection[
   JDBC["com.microsoft.sqlserver.jdbc.SQLServerDriver", "jdbc:sqlserver://myserver;DatabaseName=dbprod;authentication=ActiveDirectoryIntegrated"], 
   "Name" -> "DataLake", "Catalog" -> Automatic, 
   "Description" -> None, "ReadOnly" -> Automatic, 
   "RelativePath" -> False, "TransactionIsolationLevel" -> Automatic, 
   "UseConnectionPool" -> Automatic];
connMS = OpenSQLConnection[sqlMS]
 
(*Success*)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.