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

# Connect to SQL Server (MSSQL)

> Connect Tamery to Microsoft SQL Server or Azure SQL: connection string format and SSL/TLS options.

Tamery accepts both `mssql://` and `sqlserver://` (identical behavior):

```bash theme={null}
mssql://username:password@hostname:1433/database
```

| Part       | Description                                 |
| ---------- | ------------------------------------------- |
| `username` | SQL Server login (e.g. `sa`)                |
| `password` | Password for that login                     |
| `hostname` | Host (e.g. `localhost` or a remote address) |
| `1433`     | Port (default)                              |
| `database` | Database name                               |

## Azure SQL

Use your `.database.windows.net` hostname. Azure SQL requires encryption.

```bash theme={null}
sqlserver://username:password@your-server.database.windows.net:1433/your-database?encrypt=true&trustServerCertificate=false
```

## SSL / TLS

Both default to `true` when unset.

| Parameter                      | Description                                                     |
| ------------------------------ | --------------------------------------------------------------- |
| `encrypt=true`                 | Encrypt the connection. Required for Azure SQL.                 |
| `encrypt=false`                | No encryption. Local dev only.                                  |
| `trustServerCertificate=true`  | Skip certificate validation. Local dev with self-signed certs.  |
| `trustServerCertificate=false` | Validate against a trusted CA. Use in production and Azure SQL. |

**Local with self-signed cert:**

```bash theme={null}
mssql://sa:password@localhost:1433/mydb?encrypt=true&trustServerCertificate=true
```

**Production / Azure SQL:**

```bash theme={null}
sqlserver://username:password@hostname:1433/database?encrypt=true&trustServerCertificate=false
```

<Tip>
  For a named instance like `SQLEXPRESS`, URI-encode the backslash: `localhost%5CSQLEXPRESS`. When
  in doubt, use `127.0.0.1` with the explicit port.
</Tip>
