sync current state§

This commit is contained in:
Thierry Schork
2023-01-04 16:52:04 +01:00
parent 37470b9e4b
commit c6c072f921
10 changed files with 176 additions and 20 deletions

View File

@@ -0,0 +1,22 @@
SELECT
--CAST(event_data as XML) as event_data,
n.value('(@name)[1]', 'varchar(50)') as event_name,
n.value('(@package)[1]', 'varchar(50)') AS package_name,
n.value('(@timestamp)[1]', 'datetime2') AS [utc_timestamp],
n.value('(action[@name="client_app_name"]/value)[1]', 'nvarchar(max)') as client_app_name,
n.value('(action[@name="event_sequence"]/value)[1]', 'bigint') AS event_sequence,
n.value('(data[@name="duration"]/value)[1]', 'int') as duration,
n.value('(data[@name="cpu_time"]/value)[1]', 'int') as cpu,
n.value('(data[@name="physical_reads"]/value)[1]', 'int') as physical_reads,
n.value('(data[@name="logical_reads"]/value)[1]', 'int') as logical_reads,
n.value('(data[@name="writes"]/value)[1]', 'int') as writes,
n.value('(data[@name="row_count"]/value)[1]', 'int') as row_count,
n.value('(data[@name="last_row_count"]/value)[1]', 'int') as last_row_count,
n.value('(data[@name="statement"]/value)[1]', 'nvarchar(max)') as statement,
n.value('(data[@name="sql_text"]/value)[1]', 'nvarchar(max)') as sql_text
from (select cast(event_data as XML) as event_data
from sys.fn_xe_file_target_read_file('D:\SSMS projects\OCTPDBA-444 - Disable CASH Synchronization in Centrals\sunCent\octpdba-443_azcash_0_133171837677290000.xel', null, null, null)) ed
cross apply ed.event_data.nodes('event') as q(n)
WHERE n.value('(action[@name="client_app_name"]/value)[1]', 'nvarchar(max)') = 'APS® TriaOne-Cash'
AND n.value('(data[@name="duration"]/value)[1]', 'int') IS NOT NULL
ORDER BY n.value('(action[@name="event_sequence"]/value)[1]', 'bigint') ASC