Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d161474

Browse files
Wait no, this does
Count of deadlocks by proc
1 parent fb38a32 commit d161474

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

‎sp_BlitzLock.sql‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,10 +545,23 @@ SET @VersionDate = '20171201';
545545

546546

547547
/*Check 8 gives you stored proc deadlock counts*/
548-
549-
SELECT ds.id, ds.proc_name, ds.sql_handle
548+
INSERT #deadlock_findings ( check_id, database_name, object_name, finding_group, finding )
549+
SELECT 8 AS check_id,
550+
DB_NAME(dp.database_id) AS database_name,
551+
ds.proc_name,
552+
'Stored Procedure Deadlocks',
553+
'The stored procedure '
554+
+ PARSENAME(ds.proc_name, 2)
555+
+ '.'
556+
+ PARSENAME(ds.proc_name, 1)
557+
+ ' has been involved in '
558+
+ CONVERT(NVARCHAR(10), COUNT_BIG(DISTINCT ds.id))
559+
+ ' deadlocks.'
550560
FROM #deadlock_stack AS ds
561+
JOIN #deadlock_process AS dp
562+
ON dp.id = ds.id
551563
WHERE ds.proc_name <> 'adhoc'
564+
GROUP BY DB_NAME(dp.database_id), ds.proc_name
552565
OPTION(RECOMPILE);
553566

554567

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /