Skip to content

Commit c5405fd

Browse files
Quality assurance
1 parent ac6bb26 commit c5405fd

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

sp_BlitzLock.sql

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,7 @@ BEGIN
20242024
N' instances of Serializable deadlocks.',
20252025
sort_order =
20262026
ROW_NUMBER()
2027-
OVER (ORDER BY COUNT_BIG(DISTINCT dow.event_date) DESC)
2027+
OVER (ORDER BY COUNT_BIG(DISTINCT dp.event_date) DESC)
20282028
FROM #deadlock_process AS dp
20292029
WHERE dp.isolation_level LIKE N'serializable%'
20302030
AND (dp.database_name = @DatabaseName OR @DatabaseName IS NULL)
@@ -2067,7 +2067,7 @@ BEGIN
20672067
N' instances of Repeatable Read deadlocks.',
20682068
sort_order =
20692069
ROW_NUMBER()
2070-
OVER (ORDER BY COUNT_BIG(DISTINCT dow.event_date) DESC)
2070+
OVER (ORDER BY COUNT_BIG(DISTINCT dp.event_date) DESC)
20712071
FROM #deadlock_process AS dp
20722072
WHERE dp.isolation_level LIKE N'repeatable%'
20732073
AND (dp.database_name = @DatabaseName OR @DatabaseName IS NULL)
@@ -2241,7 +2241,7 @@ BEGIN
22412241
) + N' locks.',
22422242
sort_order =
22432243
ROW_NUMBER()
2244-
OVER (ORDER BY CONVERT(bigint, lt2.lock_count) DESC)
2244+
OVER (ORDER BY CONVERT(bigint, lt.lock_count) DESC)
22452245
FROM lock_types AS lt
22462246
OPTION(RECOMPILE);
22472247

@@ -2826,7 +2826,7 @@ BEGIN
28262826
N' [dd hh:mm:ss:ms] of deadlock wait time.',
28272827
sort_order =
28282828
ROW_NUMBER()
2829-
OVER (ORDER BY wt.total_wait_time_ms DESC)
2829+
OVER (ORDER BY SUM(CONVERT(bigint, wt.total_wait_time_ms)) DESC)
28302830
FROM wait_time AS wt
28312831
GROUP BY
28322832
wt.database_name
@@ -2980,8 +2980,7 @@ BEGIN
29802980
database_name,
29812981
object_name,
29822982
finding_group,
2983-
finding,
2984-
sort_order
2983+
finding
29852984
)
29862985
VALUES
29872986
(

0 commit comments

Comments
 (0)