SQL Server
Connect a Microsoft SQL Server database to Credible with a SQL Server login, and choose how the connection is encrypted
Credible connects to Microsoft SQL Server with a SQL Server login (a username and password). Windows and Microsoft Entra sign-in are not supported.
A SQL Server connection is read-only. Credible queries it but does not write to it, so a source marked #@ persist on SQL Server is refused when the model loads.
Create a Login
Create a login and a database user with read access. Run this on the server, replacing the names and password:
CREATE LOGIN credible_readonly WITH PASSWORD = '<strong password>';
USE sales;
CREATE USER credible_readonly FOR LOGIN credible_readonly;
ALTER ROLE db_datareader ADD MEMBER credible_readonly;db_datareader reads every table and view in the database. To limit Credible to some schemas, grant SELECT on those schemas instead.
Connection Fields
| Field | Example | Notes |
|---|---|---|
| Server | sql.example.com | A host name. See Database TLS before using an IP address |
| Port | 1433 | Required unless you give an Instance name |
| Database Name | sales | |
| Username | credible_readonly | A SQL Server login |
| Password | ||
| Instance name | SQLEXPRESS | Optional. A named instance, found through the SQL Server Browser service on UDP port 1434. When set, Port is not used. Leave it empty for the default instance |
Database TLS
| Option | Encrypted | Certificate checked |
|---|---|---|
| Encrypt and verify the certificate (default) | Yes | Yes: it must be signed by a public authority and issued for the server name |
| Encrypt, skip certificate check | Yes | No |
| No encryption | No | No |
Keep the default for a server whose certificate comes from a public authority. Choose Encrypt, skip certificate check for a server with a self-signed certificate, which is common on self-hosted SQL Server. Use it only for a server you control. A server that requires encryption refuses No encryption.
Host name in certificate is the name the server's certificate is issued to, when that differs from Server. Set it when you connect by IP address: the certificate names a host, not an IP, so the check fails without it. It applies only with Encrypt and verify the certificate.
Network Access
The server needs to be reachable from the public internet on its port, and from Credible's egress addresses if it sits behind an allowlist. Named instances also need UDP port 1434 open for SQL Server Browser. See Network Access.
From the CLI
To add the connection with cred add connection, put an entry like this in the JSON file:
[
{
"name": "warehouse",
"type": "sqlserver",
"sqlserverConnection": {
"server": "sql.example.com",
"port": 1433,
"database": "sales",
"user": "credible_readonly",
"password": "..."
}
}
]Database TLS is two settings: leave both out for Encrypt and verify the certificate; set "trustServerCertificate": true for Encrypt, skip certificate check; set "encrypt": false for No encryption. The other settings are instanceName and hostNameInCertificate.
Troubleshooting
| Problem | Cause | Fix |
|---|---|---|
| A generic certificate or connection error when Server is an IP address | The certificate is issued for a host name, so it cannot match an IP | Put the host name in Server, or set Host name in certificate |
self signed certificate | The server's certificate is not signed by a public authority | Choose Encrypt, skip certificate check |
Login failed for user | Wrong username or password, or the server accepts Windows sign-in only | Check the login. Turn on SQL Server and Windows Authentication mode on the server |
Failed to connect ... in 15000ms | The server or port is not reachable from Credible | Check the firewall and allowlist. For a named instance, open UDP 1434 |
The SELECT permission was denied | The user lacks read access | Add the user to db_datareader, or grant SELECT on the schema |