ZeroDBA Diagnostic Script
Run this T-SQL script on your SQL Server instance to generate the JSON output that ZeroDBA Analyzer expects.
-- ============================================
-- ZeroDBA Diagnostic Script for Analyzer Input
-- Returns JSON compatible with the Analyzer app
-- Tested on SQL Server 2016 SP2+
-- ============================================
SET NOCOUNT ON;
DECLARE @DiagnosticOutput TABLE (
checkId NVARCHAR(100),
rawData NVARCHAR(MAX)
);
-- 1. SQL Server Version and OS
INSERT INTO @DiagnosticOutput
SELECT 'version_info', (
SELECT @@VERSION AS version
FOR JSON PATH, WITHOUT_ARRAY_WRAPPER
);
-- 2. CPU Core Info
INSERT INTO @DiagnosticOutput
SELECT 'core_count', (
SELECT COUNT(*) AS visibleOnlineSchedulers
FROM sys.dm_os_schedulers
WHERE status = 'VISIBLE ONLINE'
FOR JSON PATH, WITHOUT_ARRAY_WRAPPER
);
-- Add additional checks here ...
-- Final JSON Output
SELECT checkId, rawData
FROM @DiagnosticOutput
FOR JSON PATH;
Download Scripts by Version
- SQL Server 2016 Diagnostic Script
- SQL Server 2017 Diagnostic Script
- SQL Server 2019 Diagnostic Script
- SQL Server 2022 Diagnostic Script
Note: Save the JSON result to a file and paste it into the Analyzer on this site. Only metadata needed for checks is included.