# connect to ms sql server by windows authentication

**URL:** <https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788>\
**Category:** KNIME Analytics Platform\
**Created:** [May 4, 2015, 6:51am UTC](https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788 "2015-05-04T06:51:35Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![moitiedemoi](https://forum-cdn.knime.com/user_avatar/forum.knime.com/moitiedemoi/32/296_2.png) [@moitiedemoi](https://forum.knime.com/u/moitiedemoi)\
**Post date:** [May 4, 2015, 6:51am UTC](https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788/1 "2015-05-04T06:51:35Z")

</div>

i have problem to connect to our remote sql server by windows authentication. and I have searched the forum it seems the other users end up with sql authentication. so my question is does Knime node support to connect to remote ms sql server with windows authentication?

---

<div class="post-metadata">

**Author:** ![tobias.koetter](https://forum-cdn.knime.com/user_avatar/forum.knime.com/tobias.koetter/32/56844_2.png) [@tobias.koetter](https://forum.knime.com/u/tobias.koetter)\
**Post date:** [May 4, 2015, 12:02pm UTC](https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788/2 "2015-05-04T12:02:05Z")

</div>

Hi,

KNIME connects to databases via jdbc. By using the jdbc driver provided by Microsoft you should be able to conect to your database via windows authentication.

To establish the connection you have to register the MS jdbc driver in KNIME as described in the first section of the [database documentation](https://forum.knime.com/database-documentation). You then also need to make sure that the jdbc driver finds the **sqljdbc\_auth.dll**. To do so, you have to edit the knime.ini file which is located in the root directory of your KNIME installation. Open the knime.ini file in a text editor and add the VM argument _-Djava.library.path=\<path to dll_\> with the path to the dll and restart KNIME.

In KNIME you can use the _Database Connector_ node to establish a connection to any jdbc compliant db. Open the dialog of the node and select the microsoft jdbc driver from the database driver list. Enter the jdbc connection string to your database in the database url field including the **integratedSecurity=true option** e.g.

_jdbc:sqlserver{HOST};Database={DB\_NAME};integratedSecurity=true_

Bye,

Tobias

---

<div class="post-metadata">

**Author:** ![FrancoisD](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/f/51bf81/32.png) [@FrancoisD](https://forum.knime.com/u/FrancoisD)\
**Post date:** [July 28, 2015, 10:12am UTC](https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788/3 "2015-07-28T10:12:07Z")

</div>

Hi,

I had the same problem trying to connect to a SQL server&nbsp;by windows authentication. The best solution we found was to :

&nbsp;- create a DSN in Windows (DSN = _Data Source Name_). You just have to open the ODBC Administration tool in windows and create a DSN with the data base connection

&nbsp;- In Knime,&nbsp;use a DataBase Reader node with :

- DataBase Driver &nbsp;=&nbsp;jdbc. **odbc**.JdbcOdbcDriver
- Database URL =&nbsp;jdbc:sqlserver:\<DSN name&nbsp;\>&nbsp;

Regards,

Francois

---

<div class="post-metadata">

**Author:** ![jtomasrl](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/j/85f322/32.png) [@jtomasrl](https://forum.knime.com/u/jtomasrl)\
**Post date:** [March 2, 2016, 6:07pm UTC](https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788/4 "2016-03-02T18:07:15Z")

</div>

how can I install the DB Driver:&nbsp;jdbc.odbc.JdbcOdbcDriver, I dont have it in the dropdown menu

---

<div class="post-metadata">

**Author:** ![thor](https://forum-cdn.knime.com/user_avatar/forum.knime.com/thor/32/4_2.png) [@thor](https://forum.knime.com/u/thor)\
**Post date:** [March 2, 2016, 10:00pm UTC](https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788/5 "2016-03-02T22:00:49Z")

</div>

The driver doesn't exist any more. It was part of Java but Oracle removed it from Java 8. See also https://tech.knime.org/forum/knime-general/generic-odbc-driver-on-knime-31

---

<div class="post-metadata">

**Author:** ![rhumecky](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/r/7cd45c/32.png) [@rhumecky](https://forum.knime.com/u/rhumecky)\
**Post date:** [September 12, 2018, 8:35pm UTC](https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788/6 "2018-09-12T20:35:03Z")

</div>

**Install JDBC Driver inside of KNIME (if not already done)**

In KNIME go to File \> Install Extensions. Search for SQL Server. Select the JDBC Driver for SQL Server, then install it.

**Download Microsoft SQL SERVER JDBC Driver**

Here is current download link (if it doesn’t work just Google “Download Microsoft SQL SERVER JDBC Driver”)

[https://www.microsoft.com/en-us/download/details.aspx?id=57175](https://www.microsoft.com/en-us/download/details.aspx?id=57175)

Choose the .exe file which will self extract the drivers to the location you choose.

In the extracted files copy the **sqljdbc\_auth.dll** file from one of 2 locations:

- **On 64bit windows use** : **sqljdbc\_7.0\ enu\auth\x64**
- **On 32bit Windows use: sqljdbc\_7.0\enu\auth\x86**

**Copy sqljdbc\_auth.dll into KNIME Java directories (3 Locations)**

Paste the same sqljdbc\_auth.dll into 3 locations in the jre directory in the KNIME installation:

- jre folder (My jre folder is located at **: C:\Program Files\KNIME\plugins\org.knime.binary.jre.win32.x86\_64\_1.8.0.152-01\jre.** The version number in your install is probably different. )
- bin folder (off the jre folder above)
- lib folder (off the jre folder above)

**Restart KNIME** (will not work without restart)

**Connection String in KNIME**

To use the integrated security bring in a SQLServer node in KNIME workflow, then select com.microsoft.sqlserver.jdbc.SQLServerDriver.

For the Database URL use:

**jdbc:sqlserver://SERVERNAME;Database=DBNAME;integratedSecurity=true**

---

<div class="post-metadata">

**Author:** ![knimeadmin](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/5f8ce5/32.png) [@knimeadmin](https://forum.knime.com/u/knimeadmin)\
**Post date:** [October 3, 2019, 9:38pm UTC](https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788/7 "2019-10-03T21:38:27Z")

</div>

Hi Rhumecky,

I followed above steps to copy the .dll file into above 3 locations on the server side. Now we want to push the sqljdbc\_auth.dll the same way on the client side for the users. Do you know how to do that using server customization client profiles?

Thanks,  
Pen

---

<div class="post-metadata">

**Author:** ![izaychik63](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/i/e9a140/32.png) [@izaychik63](https://forum.knime.com/u/izaychik63)\
**Post date:** [October 4, 2019, 11:53am UTC](https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788/8 "2019-10-04T11:53:08Z")

</div>

As for me in new version all you need to install JDBC driver from the KNIME installation and provide a parameter integratedsecurity=true in connection node.

---

<div class="post-metadata">

**Author:** ![germans](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/g/ce7236/32.png) [@germans](https://forum.knime.com/u/germans)\
**Post date:** [July 14, 2021, 9:09pm UTC](https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788/9 "2021-07-14T21:09:46Z")

</div>

Hi, how to connect with Knime for Mac to a Microsoft SQL Server with Windows Auth?  
I need some help please. I installed the extensions - and the road ends at this point.  
Copying the line to the Database URL does not work either.

Execute failed: Fehler bei der Anmeldung

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [July 14, 2021, 11:09pm UTC](https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788/10 "2021-07-14T23:09:08Z")

</div>

Hi @germans, welcome to the community!

I don’t know anything about Mac but from experience on Windows the invalid login error might not indicate a problem with Windows authentication… Do you have an instance name on your sql server database? If so it might be that you need to supply that too. Did you are this post?

> [@Unable to connect to Azure SQL database using DB connector.](https://forum.knime.com/t/unable-to-connect-to-azure-sql-database-using-db-connector/34201):
>
> Hey! I just downloaded Knime and have a sample Azure SQL database that I want to connect to. I tried using “DB Connector” node and configured the connection setting but it returns an error saying “Execute failed: Cannot open server “[defisolutions.com](http://defisolutions.com)” requested by the login. The login failed.” Can someone please help?

---

<div class="post-metadata">

**Author:** ![germans](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/g/ce7236/32.png) [@germans](https://forum.knime.com/u/germans)\
**Post date:** [July 15, 2021, 4:41am UTC](https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788/11 "2021-07-15T04:41:18Z")

</div>

Hello,

I got the information from the server admin. With Tableau I have no problems to get a connection. There I have to check “Windows authentication”.

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [July 15, 2021, 5:41am UTC](https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788/12 "2021-07-15T05:41:45Z")

</div>

Hi @germans,

Sorry I didn’t mean that you weren’t needing to use Windows authentication, but simply that there could still be _something else_ wrong with your configuration that is causing the specific error message you are seeing.

For example, the login error could mean that you have not correctly defined the database instance, which is what the car was on the other post I linked to. It may be that you have Windows authentication working but if the other config is wrong you still won’t login.

Are you able to post any screenshots of your configuration, and also say what node you are using to connect, and which jdbc driver? Please obscure any confidential information, but to assist, I think it is going to be necessary to know more about your actual configuration.

(Incidentally adding the jdbc parameter  
`integratedSecurity=true`  
is the equivalent of “ticking Windows Authentication”)

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [July 15, 2021, 8:51am UTC](https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788/13 "2021-07-15T08:51:08Z")

</div>

Hello @germans and others,

here is section in database guide where you can check how to use Windows native authentication when connecting to MS SQL database:  
[https://docs.knime.com/latest/db\_extension\_guide/index.html#connecting\_examples](https://docs.knime.com/latest/db_extension_guide/index.html#connecting_examples)

Scroll down a bit to find **Connecting to Microsoft SQL Server** paragraph. (You’ll see that if KNIME Analytics Platform runs on a non-Windows machine you can’t use official Microsoft JDBC but rather jTDS built-in driver.)

Additionally I’ll close this topic and encourage everyone who has issues connecting to MS SQL DB with or without using Windows native authentication to open up a new topic with more details provided around their environment/versions/nodes&drivers used/connection strings/error received…

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [July 15, 2021, 8:51am UTC](https://forum.knime.com/t/connect-to-ms-sql-server-by-windows-authentication/7788/14 "2021-07-15T08:51:36Z")

</div>


