- Create a session with network type "Microsoft SQL Server (TCP/IP)", enter the server name, user (default sa) and password, or tick Use Windows authentication.
- The port defaults to 0, which lets the driver detect it (previously 1433); set it explicitly if your instance uses a fixed port.
- On Windows the Library field selects the provider: MSOLEDBSQL by default; the older SQLOLEDB triggers a warning because it uses TLS 1.0.
- An SSH tunnel is available for the SQL Server TCP/IP type; HeidiSQL's SSL tab is not enabled for SQL Server sessions.
- On Linux and macOS, SQL Server support runs through FreeTDS and is described by the project as not yet fully mature.
HeidiSQL SQL Server connection: step by step
- Open the Session manager and click New.
- Set Network type to Microsoft SQL Server (TCP/IP). Named pipe, SPX/IPX, Banyan VINES and Windows RPC variants also exist for older setups.
- On Windows, leave Library on MSOLEDBSQL (the Microsoft OLE DB Driver for SQL Server) unless you have a reason to change it.
- Enter Hostname / IP. Leave Port at 0 for auto-detection by the driver, or enter the instance's TCP port.
- Either enter User and Password for a SQL Server login (the default user for new sessions is
sa), or tick Use Windows authentication, which uses your current Windows session. - Optionally enter one database in Databases; HeidiSQL then passes it as the database in the connection string, which the source code notes may be required on Azure.
- Click Save and Open.
If you see a warning about "insecure TLS 1.0", you selected the old SQLOLEDB provider. HeidiSQL recommends installing the Microsoft OLE DB Driver instead.
| Setting | Default | Note |
|---|---|---|
| Network type | Microsoft SQL Server (TCP/IP) | Command line value 4 |
| Library (Windows) | MSOLEDBSQL | SQLOLEDB also listed; it uses TLS 1.0 |
| Port | 0 | Auto-detection by the driver, previously 1433 |
| User | sa | Or Use Windows authentication |
| SSH tunnel | Available | TCP/IP network type only |
| SSL tab | Not enabled | Applies to MySQL-family and PostgreSQL sessions |
SSH tunnel to SQL Server
Unlike MySQL and PostgreSQL, SQL Server has no separate "SSH tunnel" network type; instead the Use SSH tunnel option is enabled for the Microsoft SQL Server (TCP/IP) type. Fill in the SSH tunnel tab as the help page describes for other engines: SSH executable (plink.exe from the installer, or ssh.exe), SSH host and port, SSH user, password or private key file, and a free local port. Set Hostname / IP on the Settings tab to the SQL Server address as seen from the SSH server (often 127.0.0.1), because that host is used for the tunnel's -L forwarding.
Encryption and the SSL tab
The SSL tab (private key, certificate, CA certificate, cipher, verification) is only enabled for MySQL-family and PostgreSQL network types in the HeidiSQL source code, so you cannot set certificate files for a SQL Server session there. Encryption of a SQL Server connection is then left to the driver: the OLE DB provider on Windows, FreeTDS elsewhere. HeidiSQL does not document how to force or verify encryption for SQL Server. If your policy requires a verified encrypted connection, an SSH tunnel is the documented HeidiSQL option, or use a tool built for SQL Server such as SSMS.
SQL Server from Linux and macOS
The Linux and macOS builds come from the Lazarus code base, which leaves out Windows-only parts such as ADO. The README states that SQL Server support is being redeveloped via FreeTDS and is not yet fully mature. The Debian package depends on libsybdb5, the FreeTDS library. Expect gaps compared with the Windows version and check the issue tracker, which has a dedicated label for SQL Server issues. Running the Windows build under Wine is not a reliable workaround: the help page calls Wine quite unstable.
Common SQL Server connection errors
These are server-side SQL Server errors, so they read the same in HeidiSQL as in any other client:
- Error 18456, login failed: wrong password, SQL Server authentication disabled, or a Windows login without access.
- Error 4060, cannot open database: the database in the Databases field is missing or not allowed for the login.
- Error 53, server not found: wrong host or instance name, or the server is not reachable.
- Error 10061, connection refused: the host answered but nothing listens on that port; check TCP/IP is enabled and the port.
- Error 40615: on Azure SQL Database, your IP address is blocked by the server firewall.
Frequently asked questions
Can HeidiSQL connect to SQL Server?
Yes. SQL Server ("MS SQL") is one of the supported database systems. On Windows it connects through Microsoft's OLE DB providers; on Linux and macOS through FreeTDS, which is less mature.
What port does HeidiSQL use for SQL Server?
By default 0, meaning the driver detects the port. Earlier versions defaulted to 1433. Enter a port if your instance listens on a fixed one.
Does HeidiSQL support Windows authentication for SQL Server?
Yes. Tick Use Windows authentication on the Settings tab; the help page says it is available for MySQL, MariaDB and MS SQL.
Can I use SSL certificates with SQL Server in HeidiSQL?
Not through the SSL tab, which is enabled only for MySQL-family and PostgreSQL sessions. Use an SSH tunnel if you need a documented encrypted path.
Is HeidiSQL a replacement for SSMS?
For browsing data and writing queries it can be. It does not describe SQL Server administration features such as Agent jobs; see our SSMS comparisons and the SSMS review.
Sources
- HeidiSQL help: connecting, SSH tunnel, command line switches
- HeidiSQL Lazarus branch README (FreeTDS for SQL Server)
- HeidiSQL Debian package control file
- HeidiSQL source: connection code (dbconnection.pas)
- HeidiSQL source: session manager logic (connections.pas)
- HeidiSQL source: session manager form (connections.dfm)
- HeidiSQL issue tracker labels
Checked 8 October 2026.
How we research tool guides: our editorial method. CodeWithSQL earns nothing from the vendors mentioned.