SQL Server health check.
Check your SQL Server database in two minutes without handing over a password. Run one read-only DMV query and paste the JSON result here. The page highlights missing indexes suggested by the optimizer, idle non-clustered indexes, large heap tables and stuck requests — analyzed locally in your browser.
Run this query on your database
It reads only sys.* and sys.dm_* views (SQL Server 2016+ / Azure SQL) requiring VIEW DATABASE STATE, without touching table rows.
sqlserver-health.sql
-- DataRunner · SQL Server health check (read-only, SQL Server 2016+)SELECT ( SELECT 1 AS v, 'sqlserver' AS engine, CAST(SERVERPROPERTY('ProductVersion') AS nvarchar(128)) AS version, DB_NAME() AS [database], (SELECT SUM(CAST(size AS bigint)) * 8192 FROM sys.database_files) AS size_bytes, (SELECT CONVERT(varchar(30), sqlserver_start_time, 127) FROM sys.dm_os_sys_info) AS stats_reset, JSON_QUERY(ISNULL(( SELECT TOP 10 OBJECT_SCHEMA_NAME(mid.object_id) + '.' + OBJECT_NAME(mid.object_id) AS [table], ISNULL(mid.equality_columns, '') + CASE WHEN mid.inequality_columns IS NOT NULL THEN ', ' + mid.inequality_columns ELSE '' END AS cols, CAST(migs.avg_total_user_cost * migs.avg_user_impact * (migs.user_seeks + migs.user_scans) AS bigint) AS impact FROM sys.dm_db_missing_index_group_stats migs JOIN sys.dm_db_missing_index_groups mig ON mig.index_group_handle = migs.group_handle JOIN sys.dm_db_missing_index_details mid ON mid.index_handle = mig.index_handle WHERE mid.database_id = DB_ID() ORDER BY impact DESC FOR JSON PATH ), '[]')) AS missing_indexes, JSON_QUERY(ISNULL(( SELECT TOP 10 OBJECT_SCHEMA_NAME(i.object_id) + '.' + OBJECT_NAME(i.object_id) AS [table], i.name AS name, ISNULL(u.user_updates, 0) AS updates FROM sys.indexes i LEFT JOIN sys.dm_db_index_usage_stats u ON u.object_id = i.object_id AND u.index_id = i.index_id AND u.database_id = DB_ID() WHERE OBJECTPROPERTY(i.object_id, 'IsUserTable') = 1 AND i.index_id > 1 AND i.is_primary_key = 0 AND i.is_unique = 0 AND ISNULL(u.user_seeks, 0) + ISNULL(u.user_scans, 0) + ISNULL(u.user_lookups, 0) = 0 ORDER BY ISNULL(u.user_updates, 0) DESC FOR JSON PATH ), '[]')) AS unused_indexes, JSON_QUERY(ISNULL(( SELECT TOP 10 s.name + '.' + t.name AS name, SUM(p.rows) AS [rows] FROM sys.tables t JOIN sys.schemas s ON s.schema_id = t.schema_id JOIN sys.indexes i ON i.object_id = t.object_id AND i.type = 0 JOIN sys.partitions p ON p.object_id = t.object_id AND p.index_id = 0 GROUP BY s.name, t.name HAVING SUM(p.rows) > 1000 ORDER BY SUM(p.rows) DESC FOR JSON PATH ), '[]')) AS heap_tables, JSON_QUERY(ISNULL(( SELECT TOP 10 r.session_id AS sid, r.status AS status, r.wait_type AS wait_type, r.total_elapsed_time / 1000 AS seconds FROM sys.dm_exec_requests r WHERE r.database_id = DB_ID() AND r.session_id <> @@SPID AND r.total_elapsed_time > 60000 ORDER BY r.total_elapsed_time DESC FOR JSON PATH ), '[]')) AS long_requests, JSON_QUERY(ISNULL(( SELECT TOP 5 s.name + '.' + t.name AS name, SUM(ps.used_page_count) * 8192 AS bytes FROM sys.tables t JOIN sys.schemas s ON s.schema_id = t.schema_id JOIN sys.dm_db_partition_stats ps ON ps.object_id = t.object_id GROUP BY s.name, t.name ORDER BY bytes DESC FOR JSON PATH ), '[]')) AS largest_tables FOR JSON PATH, WITHOUT_ARRAY_WRAPPER) AS datarunner_sqlserver_health;From a terminal with sqlcmd, save the query to a file and run: sqlcmd -S "$SQL_SERVER" -d "$DB_NAME" -i sqlserver-health.sql -h -1 -W
Paste the result
The analysis happens in this browser. The result never leaves it.
Questions
- Does it work on Azure SQL and Amazon RDS for SQL Server?
- Yes, as long as your login has VIEW DATABASE STATE permission (or VIEW SERVER STATE to see all active sessions).
- Should I create every missing index listed?
- Not blindly. Missing-index DMVs evaluate each query in isolation — consolidate overlapping columns first so write overhead stays low.
- Is anything uploaded to DataRunner?
- No. Parsing and analysis happen entirely in your browser.
Monitor SQL Server automatically.
DataRunner schedules SQL reports and health checks on your SQL Server (including private networks via Bridge agent) and delivers to email, Slack, Telegram or WhatsApp.