> For the complete documentation index, see [llms.txt](https://docs.euno.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.euno.ai/sources/data-warehouses/sql-server-integration.md).

# SQL Server

Euno's SQL Server integration connects to Microsoft SQL Server, Azure SQL Database, and Microsoft Fabric SQL databases to discover databases, schemas, tables, views, columns, lineage, and Query Store usage.

The integration supports one source type for:

* On-premises Microsoft SQL Server 2016 and later
* Azure SQL Database
* Microsoft Fabric SQL database

## Setting up SQL Server integration

### Overview

SQL Server stores data in databases. Each database contains schemas, and each schema contains tables, views, indexed views, and columns.

Euno connects to SQL Server through Microsoft ODBC Driver 18 and reads system catalog views, `INFORMATION_SCHEMA`, and Query Store metadata. System databases (`master`, `tempdb`, `model`, and `msdb`) and system schemas are excluded from discovery.

### Step 1: Prepare SQL Server

#### Ensure SQL Server is reachable

1. Confirm that Euno can reach the SQL Server host and port. The default port is `1433`.
2. For on-premises SQL Server, allow inbound traffic from the Euno runtime network or through your private connectivity setup.
3. For Azure SQL Database, allow the Euno runtime through the Azure SQL firewall or use a Private Endpoint/private networking path.
4. For Microsoft Fabric SQL database, use the SQL database hostname (`*.database.fabric.microsoft.com`) and port `1433`.
5. Note the hostname, port, and initial database. The default initial database is `master`. For Fabric SQL databases, use the full Initial Catalog value from the connection string, including any GUID suffix.

{% hint style="info" %}
Use a Fabric **SQL database** host (`*.database.fabric.microsoft.com`). Do not use a Fabric warehouse or lakehouse SQL analytics endpoint (`*.datawarehouse.fabric.microsoft.com`).
{% endhint %}

#### Choose an authentication method

SQL Server authentication and Microsoft Entra client credentials are mutually exclusive. Euno selects the authentication method from the populated credential fields:

* SQL authentication: provide **SQL Username** and **SQL Password**.
* Entra client credentials: provide **Entra Tenant ID**, **Entra Client ID**, and **Entra Client Secret**.

Do not populate both credential families for the same source. Microsoft Fabric SQL databases use Entra client credentials. Azure SQL Database can use either method.

If you use SQL authentication, skip Step 2 and continue with [Step 3: Grant permissions](#step-3-grant-permissions).

### Step 2: Create an Entra app registration

Create a Microsoft Entra application (service principal) with a client secret for Euno. Use this app for Azure SQL Database Entra authentication and for Microsoft Fabric SQL databases.

1. Open [Microsoft Entra](https://entra.microsoft.com/) and sign in.
2. In the sidebar, pick **App registrations**.
3. Click **New registration**.
4. Fill in the name (for example, `Euno SQL Server`).
5. Under **Supported account types**, choose **Single tenant only** (your directory name appears on the option, for example **Single tenant only - Contoso**). This is the single-tenant choice — older Entra UIs labeled it **Accounts in this organizational directory only**.
6. Leave **Redirect URI** empty.
7. Click **Register**.
8. On the Overview page, copy the **Application (client) ID** and the **Directory (tenant) ID**. You will need these when configuring the source in Euno.
9. In the sidebar, pick **Certificates & secrets**.
10. Under **Client secrets**, click **New client secret**.
11. Set an expiry and optional description, then click **Add**. Copy the secret **Value** immediately — it is shown only once.

{% hint style="warning" %}
Rotate the client secret per your security policy; expired secrets cause crawl failures.
{% endhint %}

#### Optional: create a security group for the Euno application

For Microsoft Fabric SQL databases, Fabric tenant settings are often granted to a security group rather than the entire organization. Creating a group for the Euno app is recommended.

1. Open the [Azure portal](https://portal.azure.com) and sign in.
2. Open **Microsoft Entra ID**.
3. Under **Manage**, pick **Groups**.
4. Click **New group**:
   * **Group type**: Security
   * **Group name**: any name (for example, `Euno SQL Server`)
5. Under **Members**, add the app registration from Step 2, then create the group.

### Step 3: Grant permissions

Use a dedicated SQL Server login or the Entra application from Step 2. The account must be able to connect to each database you want Euno to discover.

Minimum permissions depend on which features you enable:

| Permission                                                            | Used for                                                           |
| --------------------------------------------------------------------- | ------------------------------------------------------------------ |
| Catalog visibility for databases, schemas, tables, views, and columns | Core metadata discovery                                            |
| `VIEW DEFINITION`                                                     | Object definitions, computed columns, and definition-based lineage |
| `VIEW DATABASE PERFORMANCE STATE` or `VIEW DATABASE STATE`            | Query Store usage and workload lineage                             |
| Permissions to read size and row-count metadata                       | Table row counts and storage size metadata                         |

For Query Store usage and workload lineage, each database must have Query Store enabled and readable by the Euno account.

#### Microsoft Fabric SQL database permissions

1. Open the [Fabric admin portal](https://app.fabric.microsoft.com/admin-portal) and sign in.
2. Open **Tenant settings**.
3. Under **Developer settings**, find **Service principals can call Fabric public APIs**, enable it, and grant access to the security group that contains the Euno app (or to the service principal, if your tenant allows that).
4. In Fabric, open the SQL database item and grant the service principal item-level **Read**.
5. Connect to the Fabric SQL database as an admin and create an Entra database user for the app display name from Step 2, then grant SQL permissions:

```sql
CREATE USER [Euno SQL Server] FROM EXTERNAL PROVIDER;
GRANT VIEW DEFINITION TO [Euno SQL Server];
GRANT VIEW DATABASE PERFORMANCE STATE TO [Euno SQL Server];
```

Replace `Euno SQL Server` with the exact app registration display name from Step 2.

#### Azure SQL Database permissions

**SQL authentication**

1. Create a dedicated SQL login and database user for Euno.
2. Grant catalog visibility for the databases you want to discover.
3. Grant `VIEW DEFINITION` for definition-based lineage.
4. Grant `VIEW DATABASE PERFORMANCE STATE` or `VIEW DATABASE STATE` for Query Store usage and workload lineage.
5. Grant any additional permissions needed to read row-count and storage-size metadata when that option is enabled.

**Entra client credentials**

1. Use the app registration from Step 2.
2. Connect to the Azure SQL database as an Entra admin and create a database user for the app display name, then grant SQL permissions:

```sql
CREATE USER [Euno SQL Server] FROM EXTERNAL PROVIDER;
GRANT VIEW DEFINITION TO [Euno SQL Server];
GRANT VIEW DATABASE PERFORMANCE STATE TO [Euno SQL Server];
```

Replace `Euno SQL Server` with the exact app registration display name from Step 2.

3. Grant any additional permissions needed to read row-count and storage-size metadata when that option is enabled.

### Step 4: Enable Query Store for usage and workload lineage

Query Store is required for SQL Server usage metrics and workload lineage. If Query Store is disabled or Euno cannot read its catalog views for a database, Euno still discovers catalog resources for that database, but it skips Query Store usage and workload lineage for that database. Query Store in `READ_ONLY` operation mode is still used when those views are readable.

For on-premises SQL Server 2016-2019, Query Store is often disabled by default. Enable it per database:

```sql
ALTER DATABASE [<database_name>] SET QUERY_STORE = ON;
```

Azure SQL Database and Fabric SQL databases commonly have Query Store available, but you should verify it for the databases you want to observe.

Query Store does not provide reliable per-user attribution for Euno's SQL Server usage model, so this integration does not emit per-user usage metrics.

For details on the usage properties Euno publishes, see [SQL Server Usage Data](/using-euno/usage-optimization/sql-server-usage-data.md).

### Step 5: Configure Euno's SQL Server source

1. Go to the **Sources** page.
2. Click **Add New Source** and select **SQL Server**.

Asterisk (\*) means a mandatory field.

| Configuration             | Description                                                                                                                                                                                    |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Name**\*                | Display name for this SQL Server source.                                                                                                                                                       |
| **SQL Server Hostname**\* | SQL Server hostname, named instance host, Azure SQL hostname (`*.database.windows.net`), or Fabric SQL database hostname (`*.database.fabric.microsoft.com`). Do not include protocol or port. |
| SQL Server Port           | SQL Server TCP port. Defaults to `1433`.                                                                                                                                                       |
| Initial Database          | Initial database used for connection setup. Defaults to `master`. For Fabric SQL databases, use the full Initial Catalog value, including any GUID suffix.                                     |
| SQL Username              | Username for SQL authentication. Required when using SQL authentication. Leave empty for Entra client credentials.                                                                             |
| SQL Password              | Password for SQL authentication. Required when using SQL authentication. Leave empty for Entra client credentials.                                                                             |
| Entra Tenant ID           | Microsoft Entra **Directory (tenant) ID** from Step 2. Required when using Entra client credentials.                                                                                           |
| Entra Client ID           | Microsoft Entra **Application (client) ID** from Step 2. Required when using Entra client credentials.                                                                                         |
| Entra Client Secret       | Microsoft Entra client secret **Value** from Step 2. Required when using Entra client credentials.                                                                                             |

#### Microsoft Fabric SQL database source settings

1. Open the Fabric SQL database connection string and extract the hostname, port, and full Initial Catalog / Database value.
2. Set **SQL Server Hostname** to the `*.database.fabric.microsoft.com` host.
3. Set **SQL Server Port** to `1433`.
4. Set **Initial Database** to the full database name, including any GUID suffix.
5. Leave **SQL Username** and **SQL Password** empty.
6. Provide **Entra Tenant ID**, **Entra Client ID**, and **Entra Client Secret**.
7. Under Advanced, keep **Encrypt Connection** enabled and **Trust Server Certificate** disabled unless your environment requires otherwise.
8. Optionally set **Database Pattern** to allow only the full Fabric database name if other databases are visible on the same host.

#### Azure SQL Database source settings

1. Extract the hostname (`*.database.windows.net`), port, and database name from the Azure SQL connection string.
2. Choose SQL authentication or Entra client credentials.
3. Keep **Encrypt Connection** enabled for Azure SQL.

### Step 6: Schedule

1. Enable the Schedule option.
2. Choose:
   1. **Weekly**: Set specific days and times.
   2. **Hourly**: Define the interval in hours.

### Step 7: Resource Cleanup

* **Immediate Cleanup**: Remove resources not detected in the most recent successful source integration run.
* **No Cleanup**: Keep all resources indefinitely, even if they are no longer detected.

For a detailed explanation on Euno's cleanup strategies, see [Resource Sponsorship in Euno](/developer-reference/technical-concepts/resource-sponsorship-and-cleanup-in-euno.md).

### Step 8: Advanced Settings

Click **Advanced** to display these additional settings.

| Configuration                                                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Encrypt Connection                                            | Encrypt the SQL Server connection. Azure SQL and Fabric SQL databases usually require this enabled.                                                                                                                                                                                                                                                                                                                                                                                                           |
| Trust Server Certificate                                      | Trust the server certificate without normal certificate-chain validation. Use only when SQL Server presents a self-signed or private-CA certificate that Euno cannot otherwise validate.                                                                                                                                                                                                                                                                                                                      |
| Override SQL Server Instance Name                             | Custom display name for the SQL Server instance in Euno. Defaults to the hostname.                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Override SQL Server Hostname for URIs                         | Stable hostname used in generated `mssql.` URIs. Euno normalizes both configured and overridden hostnames to the first DNS label and strips any `\INSTANCE` suffix. Use this override when you need a different first label in resource URIs.                                                                                                                                                                                                                                                                 |
| Extract Row Counts and Sizes                                  | Read row-count and storage-size metadata. Enabled by default. If this metadata is unavailable, Euno still discovers catalog resources and omits the row-count and size fields.                                                                                                                                                                                                                                                                                                                                |
| Extract Query Store Usage                                     | Read Query Store to emit table usage counts and last access/write timestamps. Enabled by default.                                                                                                                                                                                                                                                                                                                                                                                                             |
| Extract Query Store Lineage                                   | Read Query Store plans and SQL text to infer workload table lineage. Enabled by default.                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Parse Query Store SQL with Eunolizer (Falls Back to Plan XML) | Runs Eunolizer first and, when enabled, uses plan XML for statements Eunolizer cannot parse. Enabling this sends Query Store SQL text, including literals, to Eunolizer, so it is opt-in and disabled by default in the UI.                                                                                                                                                                                                                                                                                   |
| Query Store Lookback Days                                     | Number of days to read from Query Store. Defaults to `60`; maximum `365`. Euno clamps this to the database's Query Store retention and only publishes 14-, 30-, or 60-day totals when that full window is available.                                                                                                                                                                                                                                                                                          |
| Max Query Store Queries Per Database                          | Per-database safety cap for Query Store workload processing. Defaults to `100000`.                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Database Pattern                                              | Regular expressions to include or exclude user databases. System databases are always excluded.                                                                                                                                                                                                                                                                                                                                                                                                               |
| Schema Pattern                                                | Regular expressions to include or exclude schemas. SQL Server system schemas are always excluded.                                                                                                                                                                                                                                                                                                                                                                                                             |
| Local Agent                                                   | Select a local agent to route traffic through when your SQL Server instance is inside a private network. For a named instance (`HOST\INSTANCE`), set **SQL Server Port** to the instance's static TCP port and use a port other than `1433`. Euno omits the default named-instance port `1433` from the connection string, and SQL Browser dynamic-port resolution is unavailable through the agent tunnel. See [Local Agents](/setup-configuration/account-settings/local-agents.md) for setup instructions. |

{% hint style="info" %}
Catalog lineage for views, indexed views, and computed columns always sends object SQL to Eunolizer during discovery. **Parse Query Store SQL with Eunolizer (Falls Back to Plan XML)** controls only Query Store workload parsing.
{% endhint %}

**Credentials from a local agent:** when a local agent is selected, the SQL username, password, and Entra client secret can be fetched from your own secret store at connection time instead of being stored in Euno — pick a handle in the **from agent** dropdowns under Advanced. See [Local Agents — secret handles](/setup-configuration/account-settings/local-agents.md#fetching-credentials-from-your-vault-secret-handles).

### Step 9: Save Configuration

Click **Test & Save** to validate the connection and permissions before saving.

## Discovered Resources

For detailed information about discovered resources, properties, relationships, and URI patterns, see [SQL Server Integration Discovered Resources](/sources/data-warehouses/sql-server-integration/sql-server-integration-discovered-resources.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.euno.ai/sources/data-warehouses/sql-server-integration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
