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

FieldExampleNotes
Serversql.example.comA host name. See Database TLS before using an IP address
Port1433Required unless you give an Instance name
Database Namesales
Usernamecredible_readonlyA SQL Server login
Password
Instance nameSQLEXPRESSOptional. 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

OptionEncryptedCertificate checked
Encrypt and verify the certificate (default)YesYes: it must be signed by a public authority and issued for the server name
Encrypt, skip certificate checkYesNo
No encryptionNoNo

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

ProblemCauseFix
A generic certificate or connection error when Server is an IP addressThe certificate is issued for a host name, so it cannot match an IPPut the host name in Server, or set Host name in certificate
self signed certificateThe server's certificate is not signed by a public authorityChoose Encrypt, skip certificate check
Login failed for userWrong username or password, or the server accepts Windows sign-in onlyCheck the login. Turn on SQL Server and Windows Authentication mode on the server
Failed to connect ... in 15000msThe server or port is not reachable from CredibleCheck the firewall and allowlist. For a named instance, open UDP 1434
The SELECT permission was deniedThe user lacks read accessAdd the user to db_datareader, or grant SELECT on the schema

Next Steps

On this page