# Connect to SQL server with TCP protocol

**URL:** <https://forum.elixirforum.com/t/connect-to-sql-server-with-tcp-protocol/56501>\
**Category:** Questions\
**Tags:** sql, tcp, gen\_tcp, tds\
**Created:** [June 14, 2023, 3:02pm UTC](https://forum.elixirforum.com/t/connect-to-sql-server-with-tcp-protocol/56501 "2023-06-14T15:02:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![santoshbt](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/santoshbt/32/29908_2.png) [@santoshbt](https://forum.elixirforum.com/u/santoshbt)\
**Post date:** [June 14, 2023, 3:02pm UTC](https://forum.elixirforum.com/t/connect-to-sql-server-with-tcp-protocol/56501/1 "2023-06-14T15:02:53Z")

</div>

Hello,

I want to connect to SQL server using TCP protocol.  
I tried Tds, it does not seem to be supporting properly.  
mssqlex is not compatible with my current dependencies.

Please let me know, if anybody have connected to SQL over TCP protocol using Tds.

Thanks,  
Santosh

---

<div class="post-metadata">

**Author:** ![hst337](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/h/41988e/32.png) [@hst337](https://forum.elixirforum.com/u/hst337)\
**Post date:** [June 14, 2023, 4:41pm UTC](https://forum.elixirforum.com/t/connect-to-sql-server-with-tcp-protocol/56501/2 "2023-06-14T16:41:11Z")

</div>

> [@santoshbt](#):
>
> I tried Tds, it does not seem to be supporting properly.

Can you please share the error, tds version, and your dbms name and version?

---

<div class="post-metadata">

**Author:** ![santoshbt](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/santoshbt/32/29908_2.png) [@santoshbt](https://forum.elixirforum.com/u/santoshbt)\
**Post date:** [June 14, 2023, 5:03pm UTC](https://forum.elixirforum.com/t/connect-to-sql-server-with-tcp-protocol/56501/3 "2023-06-14T17:03:33Z")

</div>

Hi,

Error is

\*\* (DBConnection.ConnectionError) connection not available and request was dropped from queue after 10044ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:

1. Ensuring your database is available and that you can connect to it
2. Tracking down slow queries and making sure they are running fast enough
3. Increasing the pool\_size (although this increases resource consumption)
4. Allowing requests to wait longer by increasing :queue\_target and :queue\_interval

See DBConnection.start\_link/2 for more information

Tds I am using [GitHub - elixir-ecto/tds: TDS Driver for Elixir · GitHub](https://github.com/elixir-ecto/tds)  
Dbms: Remote Microsoft SQL server

The same connection is working via pymssql in Python.  
Also, if I execute python script in Elixir using “erlport”, it is working fine.

Thanks
