> 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/using-euno/usage-optimization/sql-server-usage-data.md).

# SQL Server Usage Data

When **Extract Query Store Usage** is enabled and Query Store is readable, Euno publishes Query Store activity onto `table` resources.

| Property                                                                        | Description                                                                |
| ------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| `total_read_queries_14d`, `total_read_queries_30d`, `total_read_queries_60d`    | Query Store read execution counts for each fully covered standard window.  |
| `total_write_queries_14d`, `total_write_queries_30d`, `total_write_queries_60d` | Query Store write execution counts for each fully covered standard window. |
| `last_accessed_at`                                                              | Last observed read access time.                                            |
| `last_written_at`                                                               | Last observed write time.                                                  |
| `popular_queries`                                                               | Representative popular Query Store statements for the table.               |

The source reads up to 60 days by default. Euno clamps that lookback to the database's Query Store retention and publishes a standard window only when the available history covers it completely. For example, a 30-day effective lookback publishes 14- and 30-day totals but leaves the 60-day totals unavailable.

These values appear on the resource **Usage** tab with the standard 14-, 30-, and 60-day selector. Query Store does not provide reliable per-user attribution for this integration, so Euno does not emit per-user usage metrics for SQL Server.

## Coverage and unavailable values

The metrics reflect Query Store evidence that Euno could resolve:

* If Query Store retention or the configured lookback does not fully cover a standard window, that window's read and write totals remain unavailable rather than reporting partial history.
* If individual Query Store statements cannot be attributed, published totals include only the resolved subset and may undercount. The source run report lists parse failures.
* If a database reaches **Max Query Store Queries Per Database**, standard window totals remain unavailable because the workload was intentionally capped.

## Querying usage with EQL

Use the standard cross-warehouse properties to find active tables:

```
type = 'table' AND total_read_queries_30d > 0
```

```
type = 'table' AND total_write_queries_30d > 0
```

Use the access timestamps when you need freshness rather than a specific count window:

```
type = 'table' AND last_accessed_at is not null
```

```
type = 'table' AND last_written_at is not null
```

{% hint style="info" %}
`query_count_by_window_days` and `write_count_by_window_days` remain as deprecated compatibility fields. Use the standard 14-, 30-, and 60-day properties for new EQL queries.
{% endhint %}

See [SQL Server](/sources/data-warehouses/sql-server-integration.md) for setup, including Azure SQL Database and Microsoft Fabric SQL database permissions for Query Store.


---

# 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/using-euno/usage-optimization/sql-server-usage-data.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.
