You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sp_HumanEvents/sp_HumanEventsBlockViewer.sql
+52-17Lines changed: 52 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -878,6 +878,12 @@ CREATE TABLE
878
878
sort_order bigint
879
879
);
880
880
881
+
CREATETABLE
882
+
#sp_server_diagnostics_component_result
883
+
(
884
+
sp_server_diagnostics_component_result xml
885
+
);
886
+
881
887
IFLOWER(@target_type) =N'table'
882
888
BEGIN
883
889
GOTO TableMode;
@@ -962,9 +968,11 @@ BEGIN
962
968
END;
963
969
END;
964
970
965
-
/* Dump whatever we got into a temp table */
971
+
/*
972
+
Dump whatever we got into a temp table
973
+
Note that system_health hits this branch if we use the ring_buffer target.
974
+
*/
966
975
IFLOWER(@target_type) =N'ring_buffer'
967
-
AND @is_system_health =0
968
976
BEGIN
969
977
IF @azure =0
970
978
BEGIN
@@ -1205,24 +1213,51 @@ IF @is_system_health = 1
1205
1213
BEGIN
1206
1214
IF @debug =1
1207
1215
BEGIN
1208
-
RAISERROR('Inserting to #sp_server_diagnostics_component_result for system health: %s', 0, 1, @is_system_health_msg) WITHNOWAIT;
1216
+
RAISERROR('Inserting to #sp_server_diagnostics_component_result for target type: %s and system health: %s', 0, 1, @target_type, @is_system_health_msg) WITHNOWAIT;
1209
1217
END;
1210
1218
1211
-
SELECT
1212
-
xml.sp_server_diagnostics_component_result
1213
-
INTO #sp_server_diagnostics_component_result
1214
-
FROM
1215
-
(
1219
+
IF @target_type =N'ring_buffer'
1220
+
BEGIN
1221
+
INSERT
1222
+
#sp_server_diagnostics_component_result
1223
+
WITH
1224
+
(TABLOCKX)
1225
+
(
1226
+
sp_server_diagnostics_component_result
1227
+
)
1216
1228
SELECT
1217
-
sp_server_diagnostics_component_result =
1218
-
TRY_CAST(fx.event_dataASxml)
1219
-
FROMsys.fn_xe_file_target_read_file(N'system_health*.xel', NULL, NULL, NULL) AS fx
0 commit comments