# Microsoft SQL Server Add a Microsoft SQL Server Enrichment Datastore

Source: https://userguide.qualytics.io/source-datastore/datastore/jdbc/microsoft-sql-server/how-tos/add-enrichment/

An **enrichment datastore** is where Qualytics writes its findings: scan results, source record examples, remediation snapshots, materialized copies, and exports. Keep it on a dedicated schema or storage path, separate from the source data you govern. When a source datastore is linked to it, that source's writes land there. The destination can share the source's connection when those credentials have the required write access.

To use a Microsoft SQL Server datastore as a destination, its connection user needs the write grants listed under [Additional Permissions for an Enrichment Datastore](https://userguide.qualytics.io/source-datastore/datastore/jdbc/microsoft-sql-server/permissions/#additional-permissions-for-enrichment-destination). Then link it from the datastore that will write to it: open its **Settings**  menu, click **Enrichment** , and either pick the Microsoft SQL Server datastore under **Use existing** or create it there under **Add new**. The second step of the Add Datastore page offers the same choice through a selector: **Existing Destination** picks a datastore already set up, while **Existing Connection** and **New Connection** create one. The flow is the same for every connector and is documented once, in [Link an Enrichment Destination](https://userguide.qualytics.io/source-datastore/enrichment-datastore/how-tos/link-enrichment/) and [Link Enrichment on Datastore Creation](https://userguide.qualytics.io/source-datastore/enrichment-datastore/how-tos/link-during-creation/).

The rest of this page covers only what is specific to Microsoft SQL Server: the fields you fill in when creating the destination on Microsoft SQL Server from inside that dialog. For what Qualytics writes and how the outputs are named, see [Enrichment Outputs](https://userguide.qualytics.io/source-datastore/enrichment-datastore/deep-dive/tables/).

## Field reference

The **Enrichment Destination** step shows the sections below when Microsoft SQL Server is selected. When reusing an existing connection, the **Connection Properties** section, with its **Secrets Management**, **Authentication**, and **Advanced** groups, comes already filled in and read-only.

### Connection Properties

These fields define the SQL Server instance Qualytics connects to, in the order the form shows them. They are the same fields as on the source datastore flow, repeated here so this section stands on its own.

| Field | Required | Type | Description |
| --- | --- | --- | --- |
| **Connection Name** | Yes | Text | A label for the saved connection (e.g., `acme_sqlserver_enrichment`), so other datastores can reuse it later. |
| **HashiCorp Vault** | No | Toggle | Sits in the collapsed **Secrets Management** group, right below **Connection Name**. Turn it on to pull credentials from a secrets manager instead of typing them into the form; it shows the six fields below. Despite the label, any secrets manager that exposes a compatible REST API works, not only HashiCorp Vault; see [HashiCorp Vault](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/hashicorp-vault/). |
| **Login URL** | Yes | Text | Shown when **HashiCorp Vault** is on. The full URL of the login endpoint (e.g., `https://vault.example.com/v1/auth/approle/login`). With Vault namespaces, add the namespace after `/v1/`, as in `/v1/<namespace>/auth/approle/login`. |
| **Credentials Payload** | Yes | Text | Shown when **HashiCorp Vault** is on. A JSON body containing the credentials Vault expects (e.g., `{"role_id":"...","secret_id":"..."}`). |
| **Token JSONPath** | Yes | Text | Shown when **HashiCorp Vault** is on. The JSONPath that extracts the client token from Vault's response. Defaults to `$.auth.client_token`. |
| **Secret URL** | Yes | Text | Shown when **HashiCorp Vault** is on. The full URL of the secret, including `https://` and the host (e.g., `https://vault.example.com/v1/secret/data/sqlserver`). With Vault namespaces, add the namespace after `/v1/`. |
| **Token Header Name** | Yes | Text | Shown when **HashiCorp Vault** is on. The HTTP header name used to send the token. Defaults to `X-Vault-Token`. |
| **Data JSONPath** | Yes | Text | Shown when **HashiCorp Vault** is on. The JSONPath that extracts the key/value pairs from Vault's response. Use `$.data.data` for a KV version 2 secret (its API path contains `/data/`) and `$.data` for KV version 1 or the database secrets engine. The form pre-fills `$.data`. |
| **Host** | Yes | Text | The hostname or address of the SQL Server instance. |
| **Port** | No | Number | The port the server listens on. Left empty, the connection uses the default `1433`. |
| **Instance** | No | Text | The named instance to connect to. A port is always sent with the connection, using `1433` when you leave **Port** empty, and SQL Server connects on that port and then checks the instance name against it. Fill this in only when the named instance listens on the port you provide. |

> **Note**
>
> Reference a key from the secret in any **Connection Properties** or **Authentication** field with `${key}`, for example `${password}`. Write it with braces (`${key}`, never `$.key`) and match the key name's case. Qualytics resolves it each time the connection is opened, so a changed value takes effect on the next connection. Setup steps, the namespace rule, and a troubleshooting page are on the [HashiCorp Vault](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/hashicorp-vault/) pages.

### Authentication

Choose how Qualytics authenticates to SQL Server. Setting **Type** changes the credential fields shown below it, so pick the tab that matches your choice. These fields also belong to the connection: already filled in and read-only when reusing one. They are the same fields as on the source datastore flow, repeated here so this section stands on its own.

**Tab: Username & Password**

| Field | Required | Type | Description |
| --- | --- | --- | --- |
| **Type** | No | Option | Set to **Username & Password**, which is the default (`BASIC` in the API). |
| **User** | Yes | Text | The SQL Server login Qualytics connects as. |
| **Password** | Yes | Text | The password for that login. |

**Tab: Service Principal**

| Field | Required | Type | Description |
| --- | --- | --- | --- |
| **Type** | No | Option | Set to **Service Principal** to authenticate through Microsoft Entra ID (`SERVICE_PRINCIPAL` in the API). |
| **Client ID** | Yes | Text | The application (client) ID of the Microsoft Entra ID app registration. Sent as the connection's `username` in the API. |
| **Client Secret** | Yes | Text | The client secret generated for that app registration. Sent as the connection's `password` in the API. |
| **Tenant ID** | Yes | Text | The Microsoft Entra ID tenant ID the app registration belongs to. |

> **Note: Service Principal prerequisites**
>
> The service principal needs to exist as a user in the target database, with the same permissions a login would need.

### Advanced

A collapsed group at the end of **Connection Properties**, below **Authentication**. It also belongs to the connection.

| Field | Required | Type | Description |
| --- | --- | --- | --- |
| **Max Parallelization** | No | Number | Caps how many queries Qualytics runs at the same time against a datastore reached through this connection, from 1 to 100. Leave it empty for no explicit limit. The cap applies per datastore, so datastores sharing this connection each get their own allowance. See [Max Parallelization](https://userguide.qualytics.io/source-datastore/datastore/deep-dive/connection/#max-parallelization). |

### Location

Where Qualytics writes the enrichment tables.

| Field | Required | Type | Description |
| --- | --- | --- | --- |
| **Database** | Yes | Option | The database Qualytics writes the enrichment tables into. Pick exactly one. |
| **Schema** | Yes | Option | The schema inside that database where the enrichment tables are created. Make sure the login has write access to it. |

> **Warning**
>
> The account used by an enrichment datastore needs read and write access, while a source datastore needs only read access.

### General

| Field | Required | Type | Description |
| --- | --- | --- | --- |
| **Name** | Yes | Text | The name of the new datastore. |
| **Teams** | Yes | Option | Select one or more teams to associate with the datastore. |

> **Note: Table prefix**
>
> Qualytics names the Scan, Remediation, and Materialize outputs with a **Prefix**, and each source sharing a destination needs a unique one. Export tables use the normalized datastore name instead. Where you set the prefix depends on where you link the destination:
>
> - **Enrichment Destination dialog**: **Prefix** is a required field at the top of the dialog, already filled in from the datastore's name (or with its current prefix). Change it there before you click **Save**.
> - **Second step of the Add Datastore page**: Qualytics generates the prefix from the source datastore's name. To change it before creating the datastore, click **Edit prefixes**  in the **Prefix** section of this step.

### Write Behavior

Whether Qualytics profiles the written tables after each write, and whether a Scan also writes a snapshot of the anomalous records. Both appear below the destination under **After each write**, in this order. When you create a new destination in the second step of the Add Datastore page, they sit in a group named **Write Behavior**.

| Field | Required | Type | Description |
| --- | --- | --- | --- |
| **Profile written tables in the enrichment destination** | No | Toggle | On by default. After this datastore writes to the destination, Qualytics always adds the written outputs to the destination, names them, and links them to their source. With this on, Qualytics also profiles them, which types their fields and records row counts, so they are ready to use without a manual step. |
| **Remediation Strategy** | No | Choice | Controls whether and how anomalous source records are written to the enrichment destination. **None** does not write them and is the default, **Append** adds the anomalous records after each scan, and **Overwrite** keeps only the records from the latest scan. |

## Steps

Fill in these fields under **Add new**, either in the **Enrichment Destination** dialog of the datastore that will write here or in the second step of the Add Datastore page, then click **Test connection** and save. The steps are the same for every connector: see [Link an Enrichment Destination](https://userguide.qualytics.io/source-datastore/enrichment-datastore/how-tos/link-enrichment/) or [Link Enrichment on Datastore Creation](https://userguide.qualytics.io/source-datastore/enrichment-datastore/how-tos/link-during-creation/).

*Last updated: November 16, 2026.*
