Microsoft SQL Server (MSSQL) data source
Grafana ships with built-in support for Microsoft SQL Server (MSSQL). You can query and visualize data from any Microsoft SQL Server 2005 or newer, including Microsoft Azure SQL Database.
Use this data source to create dashboards, explore SQL data, and monitor MSSQL-based workloads in real time.
The following documentation helps you get started working with the Microsoft SQL Server (MSSQL) data source:
- Configure the Microsoft SQL Server data source
- Microsoft SQL Server query editor
- Microsoft SQL Server template variables
- Troubleshoot Microsoft SQL Server data source issues
Supported versions
This data source supports the following Microsoft SQL Server versions:
- Microsoft SQL Server 2005 and newer
- Microsoft Azure SQL Database
- Azure SQL Managed Instance
Grafana recommends using the latest available service pack for your SQL Server version for optimal compatibility.
Key capabilities
The Microsoft SQL Server data source supports:
- Time series queries: Visualize metrics over time using the built-in time grouping macros.
- Table queries: Display query results in table format for any valid SQL query.
- Template variables: Create dynamic dashboards with variable-driven queries.
- Annotations: Overlay events from SQL Server on your dashboard graphs.
- Alerting: Create alerts based on SQL Server query results.
- Stored procedures: Execute stored procedures and visualize results.
- Macros: Simplify queries with built-in macros for time filtering and grouping.
Additional resources
After configuring the Microsoft SQL Server data source, you can:
- Create a wide variety of visualizations
- Configure and use templates and variables
- Add transformations
- Add annotations
- Set up alerting
- Optimize performance with query caching
Related data sources
- PostgreSQL - For PostgreSQL databases.
- MySQL - For MySQL and MariaDB databases.



