Docs / SQL Server and Azure SQL

← Databases

SQL Server and Azure SQL

The driver speaks TDS itself (a patched tiberius), so there is nothing to install or download. It is written for SQL Server 2017 (14.0) and later, and for Azure SQL (not tested against the service: see the end of this page).

Connect

You pasteRead as
sqlserver://sa:pass@host:1433/master?encrypt=true&trustServerCertificate=true (or mssql://)the URL form; default port 1433
jdbc:sqlserver://host:1433;databaseName=shop;encrypt=truea JDBC URL (Microsoft's driver, jTDS or the old jdbc:microsoft:)
Server=tcp:db.example.com,1433;Database=shop;User Id=sa;Password=…;Encrypt=Truean ADO.NET or ODBC connection string

In a URL, database or databaseName names the database, and encrypt and trustServerCertificate are read as the JDBC and ADO.NET strings read them (unless sslmode is also given).

Named instances (host\SQLEXPRESS) are not looked up through the SQL Server Browser: give the instance's port. A pasted string with an instance and no port says so.

TLS: disable turns encryption off. prefer (the default) encrypts and does not check the certificate (servers often have a self-signed one), and falls back to plain if the server has no encryption. require encrypts without checking. verify-ca and verify-full both check the chain and the host name, because the TLS library always checks the name; point sslrootcert at your CA's file, or the system's trusted certificates are used.

Signing in:

Azure SQL: the gateway may send the client to the database's own node; the app follows one such redirection, except through an SSH tunnel, which leads to one address only.

Privileges

Browsing needs what the login can see. The administration tabs read:

What works

Agents

On SQL Server the statement check alone stops writes for read-only agents (no server-side read-only session); an agent's transaction is rolled back. server_activity and top_queries work. See Agents and the CLI.

Known limits

Tested on

The conformance suite runs on SQL Server 2017 and 2022 (containers), and the generic ODBC driver is tried against the same 2022 container. Azure SQL is not tested: its redirection, Entra sign-in and encryption rules are in the code but have not been run against the service.

See also: Connecting, Troubleshooting.