# issues connecting to ms sql server with integratedsecurity = true

**URL:** <https://forum.knime.com/t/issues-connecting-to-ms-sql-server-with-integratedsecurity-true/20130>\
**Category:** KNIME Analytics Platform\
**Created:** [December 18, 2019, 3:11pm UTC](https://forum.knime.com/t/issues-connecting-to-ms-sql-server-with-integratedsecurity-true/20130 "2019-12-18T15:11:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![karlfloh](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/76d3ee/32.png) [@karlfloh](https://forum.knime.com/u/karlfloh)\
**Post date:** [December 18, 2019, 3:11pm UTC](https://forum.knime.com/t/issues-connecting-to-ms-sql-server-with-integratedsecurity-true/20130/1 "2019-12-18T15:11:34Z")

</div>

The new 4.1 Microsoft SQL Server connector fails to connect to DB on the local system. I have added the following JDBC Parameters:  
integratedsecurity = true  
instancename = “Name of SQL Server instance”  
in the Connection Settings I have entered:  
Hostname: “Name of my Computer”  
Database name: “Name of DB”  
Authentication: None

All other settings are unchanged.  
The SQL Browser service is active.  
The `sqljdbc_auth.dll` is copied to Windows\System32

Using the general DB Connector works like a charm.

What I’m doing wrong?  
Any hints are welcome.  
Regards,  
Karl

---

<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:** [January 7, 2020, 8:58pm UTC](https://forum.knime.com/t/issues-connecting-to-ms-sql-server-with-integratedsecurity-true/20130/2 "2020-01-07T20:58:41Z")

</div>

Hi there @karlfloh,

what (error) message do you get? You are using same driver in both connector nodes?

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![karlfloh](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/76d3ee/32.png) [@karlfloh](https://forum.knime.com/u/karlfloh)\
**Post date:** [January 8, 2020, 10:26am UTC](https://forum.knime.com/t/issues-connecting-to-ms-sql-server-with-integratedsecurity-true/20130/3 "2020-01-08T10:26:02Z")

</div>

Hi Ivan,

the error message is:  
ERROR Microsoft SQL Server Connector 2:72 Execute failed: Fehler beim Herstellen der TCP/IP-Verbindung mit dem Host ‘NB03’, Port 1433. Fehler: ‘connect timed out. Überprüfen Sie die Verbindungseigenschaften. Stellen Sie sicher, dass eine SQL Server-Instanz auf dem Host ausgeführt wird und am Port TCP/IP-Verbindungen akzeptiert. Vergewissern Sie sich, dass am Port keine TCP-Verbindungen durch eine Firewall blockiert werden.’.  
I am using the same driver:  
Microsoft JDBC Driver 7.4 for SQL Server [ID: MSSQL\_jdbc\_741]

Regards,  
Karl

---

<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:** [January 8, 2020, 1:26pm UTC](https://forum.knime.com/t/issues-connecting-to-ms-sql-server-with-integratedsecurity-true/20130/4 "2020-01-08T13:26:16Z")

</div>

I’ve got below recommendation from Tobias.  
For the old framework nothing has changed. So here is what you need to do to connect to MS SQL Server with  
native authentication for the old framework using the official Microsoft driver:  
Install the available “” plugin in KNIME via File-\>Install  
Close KNIME and open the knime.ini file which is located in the KNIME installation directory with a text editor  
such as notepad  
Download the latest Microsoft SQL Server JDBC driver from here.  
Extract the files and copy the path to the sqljdbc\_auth.dll which is usually located in the following  
directory: sqljdbc\_7.4\enu\auth\x64 for 64 bit Windows and sqljdbc\_7.4\enu\auth\x86 for 32 bit Windows.  
Append the following line to the end of the file: -Djava.library.path=

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/f/f3694191beb735ec12bc129452b39f403a21be1c.png)  
With the new framework this is now much simple since we now ship all required DLLs with the driver. So to connect  
to your database using the new framework please follow the instructions in the database documentation.

---

<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:** [January 13, 2020, 5:37pm UTC](https://forum.knime.com/t/issues-connecting-to-ms-sql-server-with-integratedsecurity-true/20130/5 "2020-01-13T17:37:24Z")

</div>

Hello [karlfloh](https://forum.knime.com/u/karlfloh),  
as izaychick63 already stated starting with KNIME 4.1 we include the necessary dlls for the new database framework. We now also have a detailed [section](https://docs.knime.com/2019-12/db_extension_guide/index.html#connecting_to_ms_sqlserver) in the [database documentation](https://docs.knime.com/latest/db_extension_guide/index.html) that describes how to connect to a SQL Server database using native authentication. So you no longer need to copy the sqljdbc\_auth.dll file into the Windows folder but it also doesn’t hurt 🙂

You say that the _DB Connector_ node works but not the _Microsoft SQL Server Connector_ node. So this indicates to a problem with the generated JDBC URL. The _Microsoft SQL Server Connector_ node uses the following JDBC URL template:

> jdbc:sqlserver://\<host\>:\<port\>;databaseName=[database]

where host will be replaced by the value you enter in the _hostname_ field, port will be the value from the _port_ field and database will be the value from the _database name_ field but is optional. For further details about the JDBC URL template see the [documentation](https://docs.knime.com/2019-12/db_extension_guide/index.html#url_template_syntax_info).  
Bye  
Tobias

---

<div class="post-metadata">

**Author:** ![karlfloh](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/76d3ee/32.png) [@karlfloh](https://forum.knime.com/u/karlfloh)\
**Post date:** [January 13, 2020, 5:52pm UTC](https://forum.knime.com/t/issues-connecting-to-ms-sql-server-with-integratedsecurity-true/20130/6 "2020-01-13T17:52:08Z")

</div>

Thank you for clarification. But what I am missing is: where should I place the SQL-Server instancename? Because there are 5 or 6 instances running different versions of SQL Server on the system. In the Mircrosoft SQL Server Connector I have created a JDBC Parameter (named “instancename”) with the name of the instance as value, whereas in the DB Connector the instancename ist part of the URL-String: \<host\>;instancename=\<instance\>;databasename=\<databasename\>;integratedsecurity=true

---

<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:** [January 13, 2020, 8:30pm UTC](https://forum.knime.com/t/issues-connecting-to-ms-sql-server-with-integratedsecurity-true/20130/7 "2020-01-13T20:30:00Z")

</div>

It should work if you put the _instanceName_ into the JDBC parameter tab e.g.

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/2/2d396a01d20dd96f5dd84f5b144dc1979854aad4.png)  
For further details about the available parameters see the this [Microsoft article](https://docs.microsoft.com/en-us/sql/connect/jdbc/setting-the-connection-properties?view=sql-server-ver15).

---

<div class="post-metadata">

**Author:** ![karlfloh](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/k/76d3ee/32.png) [@karlfloh](https://forum.knime.com/u/karlfloh)\
**Post date:** [January 14, 2020, 7:01am UTC](https://forum.knime.com/t/issues-connecting-to-ms-sql-server-with-integratedsecurity-true/20130/8 "2020-01-14T07:01:58Z")

</div>

Hi Tobias,  
that is exactly what I have done, but the connection could not be established …

---

<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:** [January 27, 2020, 1:36pm UTC](https://forum.knime.com/t/issues-connecting-to-ms-sql-server-with-integratedsecurity-true/20130/9 "2020-01-27T13:36:47Z")

</div>

Hi karlfloh,  
this is strange. _DB Connector_ node and the _Microsoft SQL Server Connector_ node use mostly the same logic to connect to the database so there still seems to be a problem with the generated JDBC URL and the parameters. Can you please change the _KNIME log file log level_ to _DEBUG_ by opening the preferences settings via _File-\>Preferences_ and then going to the KNIME section.

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/0/01e4ba8f8b73e6203be4359066099684294cbe1a.png)

Once this is done please execute the _DB Connector_ node that works and then the _MS SQL Connector_ node that doesn’t work. You can then have a look at the KNIME log file (_View-\>Open KNIME Log_). With in the log file you can search with key combination _Ctrl+f_ for “Database session information:” which will contain the URL that KNIME uses to connect to the database e.g.

> url=jdbc:sqlserver://mysqlserver:1433;databaseName=knime

Bye  
Tobias

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [July 28, 2020, 1:47am UTC](https://forum.knime.com/t/issues-connecting-to-ms-sql-server-with-integratedsecurity-true/20130/10 "2020-07-28T01:47:34Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
