Skip to content

Commit b5d174b

Browse files
committed
Replace TRY_PARSE(... AS money) with TRY_PARSE(... AS decimal(19,2) for issue #656
1 parent 8816165 commit b5d174b

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

sp_QuickieStore/sp_QuickieStore.sql

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8869,34 +8869,34 @@ ORDER BY
88698869
THEN
88708870
CASE WHEN @regression_mode = 1
88718871
AND @regression_direction IN ('improved', 'better')
8872-
THEN 'TRY_PARSE(REPLACE(x.change_in_average_for_query_hash_since_regression_time_period, ''%'', '''') AS money) ASC,
8872+
THEN 'TRY_PARSE(REPLACE(x.change_in_average_for_query_hash_since_regression_time_period, ''%'', '''') AS decimal(19,2)) ASC,
88738873
x.query_hash_from_regression_checking,
88748874
x.from_regression_baseline_time_period'
88758875
WHEN @regression_mode = 1
88768876
AND @regression_direction IN ('regressed', 'worse')
8877-
THEN 'TRY_PARSE(REPLACE(x.change_in_average_for_query_hash_since_regression_time_period, ''%'', '''') AS money) DESC,
8877+
THEN 'TRY_PARSE(REPLACE(x.change_in_average_for_query_hash_since_regression_time_period, ''%'', '''') AS decimal(19,2)) DESC,
88788878
x.query_hash_from_regression_checking,
88798879
x.from_regression_baseline_time_period'
88808880
WHEN @regression_mode = 1
88818881
AND @regression_direction IN ('magnitude', 'absolute')
8882-
THEN 'ABS(TRY_PARSE(REPLACE(x.change_in_average_for_query_hash_since_regression_time_period, ''%'', '''') AS money)) DESC,
8882+
THEN 'ABS(TRY_PARSE(REPLACE(x.change_in_average_for_query_hash_since_regression_time_period, ''%'', '''') AS decimal(19,2))) DESC,
88838883
x.query_hash_from_regression_checking,
88848884
x.from_regression_baseline_time_period'
88858885
ELSE
88868886
CASE @sort_order
8887-
WHEN 'cpu' THEN N'TRY_PARSE(x.avg_cpu_time_ms AS money)'
8888-
WHEN 'logical reads' THEN N'TRY_PARSE(x.avg_logical_io_reads_mb AS money)'
8889-
WHEN 'physical reads' THEN N'TRY_PARSE(x.avg_physical_io_reads_mb AS money)'
8890-
WHEN 'writes' THEN N'TRY_PARSE(x.avg_logical_io_writes_mb AS money)'
8891-
WHEN 'duration' THEN N'TRY_PARSE(x.avg_duration_ms AS money)'
8892-
WHEN 'memory' THEN N'TRY_PARSE(x.avg_query_max_used_memory_mb AS money)'
8893-
WHEN 'tempdb' THEN CASE WHEN @new = 1 THEN N'TRY_PARSE(x.avg_tempdb_space_used_mb AS money)' ELSE N'TRY_PARSE(x.avg_cpu_time_ms AS money)' END
8894-
WHEN 'executions' THEN N'TRY_PARSE(x.count_executions AS money)'
8887+
WHEN 'cpu' THEN N'TRY_PARSE(x.avg_cpu_time_ms AS decimal(19,2))'
8888+
WHEN 'logical reads' THEN N'TRY_PARSE(x.avg_logical_io_reads_mb AS decimal(19,2))'
8889+
WHEN 'physical reads' THEN N'TRY_PARSE(x.avg_physical_io_reads_mb AS decimal(19,2))'
8890+
WHEN 'writes' THEN N'TRY_PARSE(x.avg_logical_io_writes_mb AS decimal(19,2))'
8891+
WHEN 'duration' THEN N'TRY_PARSE(x.avg_duration_ms AS decimal(19,2))'
8892+
WHEN 'memory' THEN N'TRY_PARSE(x.avg_query_max_used_memory_mb AS decimal(19,2))'
8893+
WHEN 'tempdb' THEN CASE WHEN @new = 1 THEN N'TRY_PARSE(x.avg_tempdb_space_used_mb AS decimal(19,2))' ELSE N'TRY_PARSE(x.avg_cpu_time_ms AS decimal(19,2))' END
8894+
WHEN 'executions' THEN N'TRY_PARSE(x.count_executions AS decimal(19,2))'
88958895
WHEN 'recent' THEN N'x.last_execution_time'
8896-
WHEN 'rows' THEN N'TRY_PARSE(x.avg_rowcount AS money)'
8897-
WHEN 'plan count by hashes' THEN N'TRY_PARSE(x.plan_hash_count_for_query_hash AS money) DESC,
8896+
WHEN 'rows' THEN N'TRY_PARSE(x.avg_rowcount AS decimal(19,2))'
8897+
WHEN 'plan count by hashes' THEN N'TRY_PARSE(x.plan_hash_count_for_query_hash AS decimal(19,2)) DESC,
88988898
x.query_hash_from_hash_counting'
8899-
ELSE CASE WHEN @sort_order_is_a_wait = 1 THEN N'TRY_PARSE(x.total_wait_time_from_sort_order_ms AS money)' ELSE N'TRY_PARSE(x.avg_cpu_time_ms AS money)' END
8899+
ELSE CASE WHEN @sort_order_is_a_wait = 1 THEN N'TRY_PARSE(x.total_wait_time_from_sort_order_ms AS decimal(19,2))' ELSE N'TRY_PARSE(x.avg_cpu_time_ms AS decimal(19,2))' END
89008900
END END
89018901
END
89028902
+ N' DESC

0 commit comments

Comments
 (0)