> ## Documentation Index
> Fetch the complete documentation index at: https://docs.summation.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SQL Server

> Connect Summation to a Microsoft SQL Server database.

Summation connects to Microsoft SQL Server — and compatible managed flavors (Azure SQL Database, Azure SQL Managed Instance, Amazon RDS for SQL Server, Google Cloud SQL for SQL Server) — using standard host/port credentials.

<Note>
  The connector authenticates with **SQL Server Authentication** (a SQL login and password). Windows Authentication and Microsoft Entra ID (Azure AD) are not supported.
</Note>

## What you'll need

* A reachable **host** and **port** (default `1433`).
* A **database** name.
* A SQL **login** with `SELECT` on the tables you want exposed. See [GRANT (Transact-SQL)](https://learn.microsoft.com/en-us/sql/t-sql/statements/grant-transact-sql) in the SQL Server docs.

<Tip>
  Create a dedicated read-only login for Summation. Its queries are then auditable and the connector has no way to modify data.
</Tip>

### Where to find host/port for your provider

| Provider                            | Where to look                                                                                                                                                                                                                                     |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Azure SQL Database**              | Azure portal → your SQL database → **Overview** → **Server name** (port `1433`). See [Connect and query](https://learn.microsoft.com/en-us/azure/azure-sql/database/connect-query-content-reference-guide).                                       |
| **Amazon RDS for SQL Server**       | RDS console → your DB instance → **Connectivity & security** → **Endpoint and port**. See [Connecting to a DB instance running SQL Server](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToMicrosoftSQLServerInstance.html). |
| **Google Cloud SQL for SQL Server** | Cloud SQL console → your instance → **Connections**. See [About connection options](https://cloud.google.com/sql/docs/sqlserver/connect-overview).                                                                                                |
| **Self-hosted**                     | The host running SQL Server, with TCP/IP enabled in **SQL Server Configuration Manager** and the port open (default `1433`).                                                                                                                      |

## Form fields

| Field                        | Required | Stored as | Notes                                                                                      |
| ---------------------------- | -------- | --------- | ------------------------------------------------------------------------------------------ |
| **Host**                     | Yes      | Config    | DNS name or IP, e.g. `sqlserver.example.com`.                                              |
| **Port**                     | Yes      | Config    | Default `1433`.                                                                            |
| **Database**                 | Yes      | Config    | The SQL Server database name.                                                              |
| **Username**                 | Yes      | Config    | SQL login.                                                                                 |
| **Password**                 | Yes      | Secret    |                                                                                            |
| **Encrypt**                  | Optional | Config    | Encrypt the connection with TLS. Default `true`.                                           |
| **Trust Server Certificate** | Optional | Config    | Skip TLS certificate validation. Default `false`; only enable for self-signed dev servers. |

### Encryption

| Setting                             | What it does                                                                                                      |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **Encrypt** `true` (default)        | TLS on. Recommended for any non-local server.                                                                     |
| **Encrypt** `false`                 | No TLS. Don't use over the public internet.                                                                       |
| **Trust Server Certificate** `true` | TLS on, but the server's certificate is not verified — use only for self-signed certificates on trusted networks. |

Most managed providers (Azure SQL, RDS, Cloud SQL) present a trusted certificate and work with **Encrypt** `true` and **Trust Server Certificate** `false`.

## Setup SQL

```sql theme={null}
CREATE LOGIN summation WITH PASSWORD = '<strong-password>';

USE analytics;
CREATE USER summation FOR LOGIN summation;
GRANT SELECT ON SCHEMA::dbo TO summation;
```

See [CREATE LOGIN](https://learn.microsoft.com/en-us/sql/t-sql/statements/create-login-transact-sql) and [CREATE USER](https://learn.microsoft.com/en-us/sql/t-sql/statements/create-user-transact-sql) for more options.

## Adding datasets

Source references use the three-part `database.schema.table` form:

```
mssql:my_database.dbo.my_table
```

Identifiers are case-sensitive when quoted. If a database, schema, or table name uses mixed case, wrap that part in double quotes — for example `mssql:my_database."MySchema"."MyTable"`.

## Common problems

| Error or symptom                   | Likely cause                                                                                                                                       |
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Login failed for user`            | Wrong login or password, or the server is in Windows-authentication-only mode. Enable **SQL Server and Windows Authentication mode** (mixed mode). |
| `connection refused` / timeout     | Wrong host/port, TCP/IP disabled on the instance, or a firewall blocking Summation's egress IPs.                                                   |
| SSL / certificate errors           | **Encrypt** doesn't match the server, or a self-signed certificate is in use. Try enabling **Trust Server Certificate**.                           |
| `The SELECT permission was denied` | Grant `SELECT` on the schema or tables to the Summation login.                                                                                     |
