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 4c10ae3

Browse files
Magic
The more you know...
1 parent b8c1d1b commit 4c10ae3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎sp_BlitzLock.sql‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ SET @VersionDate = '20171201';
716716
deadlocks
717717
AS ( SELECT dp.event_date,
718718
dp.id,
719+
dp.victim_id,
719720
dp.database_id,
720721
dp.log_used,
721722
dp.wait_resource,
@@ -744,12 +745,18 @@ SET @VersionDate = '20171201';
744745
dp.isolation_level,
745746
dp.process_xml.value('(//process/inputbuf/text())[1]', 'NVARCHAR(MAX)') AS inputbuf,
746747
ROW_NUMBER() OVER ( PARTITION BY dp.event_date, dp.id ORDER BY dp.event_date ) AS dn,
748+
DENSE_RANK() OVER ( ORDER BY dp.event_date ) AS en,
749+
ROW_NUMBER() OVER ( PARTITION BY dp.event_date ORDER BY dp.event_date ) -1 AS qn,
747750
dp.is_victim,
748751
ISNULL(dp.owner_mode, '-') AS owner_mode,
749752
ISNULL(dp.waiter_mode, '-') AS waiter_mode
750753
FROM #deadlock_process AS dp )
751754
SELECT d.event_date,
752-
DB_NAME(d.database_id) AS database_name,
755+
'Deadlock #'
756+
+ CONVERT(NVARCHAR(10), d.en)
757+
+ ', Query #' + CASE WHEN d.qn = 0 THEN N'1' ELSE CONVERT(NVARCHAR(10), d.qn) END
758+
AS deadlock_group,
759+
DB_NAME(d.database_id) AS database_name,
753760
CONVERT(XML, N'<inputbuf>' + d.inputbuf + N'</inputbuf>') AS query,
754761
d.object_names,
755762
d.isolation_level,

0 commit comments

Comments
(0)

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