Skip to content

Commit 7abf15f

Browse files
Update sp_BlitzLock.sql
Fizx Azure query
1 parent 8ac7b69 commit 7abf15f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

sp_BlitzLock.sql

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -698,12 +698,14 @@ BEGIN
698698
BEGIN
699699
RAISERROR('@TargetSessionType is event_file, assigning XML for Azure', 0, 1) WITH NOWAIT;
700700
SELECT
701-
@SessionId = t.event_session_id,
702-
@TargetSessionId = t.target_id
703-
FROM sys.dm_xe_database_session_targets AS t
704-
JOIN sys.dm_xe_database_sessions AS s
705-
ON s.event_session_id = t.event_session_id
706-
WHERE t.name = @TargetSessionType
701+
@SessionId =
702+
t.event_session_address,
703+
@TargetSessionId =
704+
t.target_name
705+
FROM sys.dm_xe_database_session_targets t
706+
JOIN sys.dm_xe_database_sessions s
707+
ON s.address = t.event_session_address
708+
WHERE t.target_name = @TargetSessionType
707709
AND s.name = @EventSessionName
708710
OPTION(RECOMPILE);
709711

0 commit comments

Comments
 (0)