Skip to content

Commit 37f3444

Browse files
committed
sp_BlitzLock - TimeZone convertion
Adjusted conversion of TimeZone that won't match with the join criteria in "Check 6"
1 parent 30a346e commit 37f3444

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
@@ -403,12 +403,19 @@ You need to use an Azure storage account, and the path has to look like this: ht
403403
/*Grab the full resource list*/
404404
SET @d = CONVERT(VARCHAR(40), GETDATE(), 109);
405405
RAISERROR('Grab the full resource list %s', 0, 1, @d) WITH NOWAIT;
406+
SELECT
407+
CONVERT(DATETIME2(7), SWITCHOFFSET(CONVERT(datetimeoffset, dr.event_date), DATENAME(TzOffset, SYSDATETIMEOFFSET()))) AS event_date,
408+
dr.victim_id,
409+
dr.resource_xml
410+
INTO #deadlock_resource
411+
FROM
412+
(
406413
SELECT dd.deadlock_xml.value('(event/@timestamp)[1]', 'DATETIME2') AS event_date,
407414
dd.deadlock_xml.value('(//deadlock/victim-list/victimProcess/@id)[1]', 'NVARCHAR(256)') AS victim_id,
408415
ISNULL(ca.dp.query('.'), '') AS resource_xml
409-
INTO #deadlock_resource
410416
FROM #deadlock_data AS dd
411417
CROSS APPLY dd.deadlock_xml.nodes('//deadlock/resource-list') AS ca(dp)
418+
) AS dr
412419
OPTION ( RECOMPILE );
413420

414421

0 commit comments

Comments
 (0)