---
title: "Set up SQL Server | Database Observability documentation"
description: "Set up Database Observability for SQL Server and managed SQL Server services using Grafana Alloy and Grafana Cloud."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Set up SQL Server

Set up Database Observability with Grafana Cloud for SQL Server databases. Choose the guide that matches your deployment type.

> Warning
> 
> Support for SQL Server is considered experimental. To enable and use an experimental component, you must run Alloy with `--stability.level=experimental`.

## How collection works

Database Observability for SQL Server uses the `database_observability.sql_server` Alloy component and collects at two different scopes from a single connection:

- **Schema details** are collected from every database on the instance that the monitoring login can access, minus excluded system databases.
- **Query metrics and query text** are collected only from the database named in the connection string, because SQL Server Query Store is per database.

Point the `data_source_name` at a user database that has Query Store enabled, not a system database such as `master`. To collect query metrics from several databases on one instance, add one [`database_instance`](https://grafana.com/docs/grafana-cloud/send-data/alloy/reference/components/database_observability/database_observability.sql_server/#database_instance) block per database.

> Note
> 
> On Azure SQL Database, the `USE` statement can’t switch databases, so each connection collects from only the database named in its connection string.
