From 49cf527131c436d588f24d42f46527c5b98b4534 Mon Sep 17 00:00:00 2001 From: Arun Gopinath Date: Sun, 26 Jul 2026 04:34:59 +0000 Subject: [PATCH] fix report.daily_summary_v2.worst_query_hash sql_variant garbling - boxing raw binary(8) query_hash into sql_variant makes CONVERT(nvarchar,...) reinterpret the bytes as UTF-16, producing garbage instead of a hash - convert to hex nvarchar before boxing, matching the style already used elsewhere in the codebase for query_hash display --- install/47_create_reporting_views.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/47_create_reporting_views.sql b/install/47_create_reporting_views.sql index c9a6023f8..11d18522e 100644 --- a/install/47_create_reporting_views.sql +++ b/install/47_create_reporting_views.sql @@ -863,7 +863,7 @@ WITH SELECT sort_order = 70, metric_name = N'worst_query_hash', - metric_value = CONVERT(sql_variant, wq.query_hash) + metric_value = CONVERT(sql_variant, CONVERT(nvarchar(20), wq.query_hash, 1)) FROM worst_query AS wq UNION ALL