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

# MSSQL

> Database connection for Microsoft SQL Server (MSSQL)

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Use this to connect Alumio to a Microsoft SQL Server (MSSQL) database. Once it is set up, the connection can be reused by other features that read from or write to your SQL Server database. You can sign in with a username and password, or with a Microsoft Entra service principal (client secret) for Azure-hosted databases. The Advanced tab holds connection tuning and encryption options that you usually do not need to touch.

This documentation describes: [Schema](/schemas/database-connection/mssql-v2)

## Fields

<FormField property="host" label="Server host" required>
  The address of the SQL Server, for example `db.example.com`. This can be a domain name or an IP address.
</FormField>

<FormField property="port" label="Server port">
  The network port the server listens on. If you leave this empty it defaults to `1433`, the standard SQL Server port. Change it only if your server uses a different port.
</FormField>

<FormField property="database" label="Database name" required>
  The name of the database on the server that you want to work with.
</FormField>

<FormField property="authenticationType" label="Authentication type">
  How Alumio signs in to the server. Choose **Username and password** for a standard SQL login (the default), or **Microsoft Entra Service Principal (client secret)** for an Azure-hosted database that uses Entra. Your choice decides which credential fields appear below.
</FormField>

<FormField property="username" label="Username">
  The username used to sign in to the database server. Shown when the authentication type is **Username and password**. Leave it empty to connect anonymously.
</FormField>

<FormField property="password" label="Password">
  The password used to sign in. Shown when the authentication type is **Username and password**. You can reference an environment variable here instead of typing the secret directly.
</FormField>

<FormField property="clientId" label="Client ID" required>
  The identifier for your client application, in the form `00000000-0000-0000-0000-000000000000`. Shown when the authentication type is **Microsoft Entra Service Principal (client secret)**.
</FormField>

<FormField property="tenantId" label="Tenant ID" required>
  The identifier for your Microsoft Entra tenant, in the form `00000000-0000-0000-0000-000000000000`. Shown when the authentication type is **Microsoft Entra Service Principal (client secret)**.
</FormField>

<FormField property="clientSecret" label="Client secret" required>
  The secret for your client application. This is only shown once, when you create it in your client application, so copy it then. Shown when the authentication type is **Microsoft Entra Service Principal (client secret)**.
</FormField>

### Advanced

<FormField property="loginTimeout" label="Connection timeout">
  How many seconds to wait before giving up on a connection attempt. Allowed range is `1` to `60`; defaults to `15`.
</FormField>

<FormField property="encrypt" label="Use encryption">
  Whether to encrypt the connection to the server. Defaults to **Enabled**. Your server may require encryption regardless of this setting.
</FormField>

<FormField property="trustServerCertificate" label="Trust server certificate">
  Whether to accept the server's encryption certificate without validating it. Defaults to **Validate certificate**. Choosing **Trust certificate without validation** weakens security, so only use it when you understand the risk.
</FormField>

## Sample data

A typical MSSQL connection using a username and password:

| Field               | Value                      |
| ------------------- | -------------------------- |
| Server host         | `your-db-host.example.com` |
| Server port         | `1433`                     |
| Database name       | `warehouse`                |
| Authentication type | `SqlPassword`              |
| Username            | `integration_user`         |
| Password            | `your-password`            |

```json theme={null}
{
    "host": "your-db-host.example.com",
    "port": "1433",
    "database": "warehouse",
    "authenticationType": "SqlPassword",
    "username": "integration_user",
    "password": "your-password"
}
```

Connection credentials are shown here as placeholders. For the password you can reference an environment variable instead of typing the secret directly; see [Placeholders](/references/placeholders) for the full syntax.

```json Configuration theme={null}
{
  "prototype": "mssql-v2",
  "parameters": {
    "host": "your-db-host.example.com",
    "port": "1433",
    "database": "warehouse",
    "authenticationType": "SqlPassword",
    "username": "integration_user",
    "password": "your-password"
  }
}
```
