use the following code to read the extended event log, why some columns no value

  • as  described the topic, and please refer the picture, thanks everyone!

    select top 10 event_data.value('(event/@timestamp)[1]', 'datetime2') as

    [Event_Time_UTC],

    event_data.value('(event/action[@name="nt_username"]/value)[1]',

    'varchar(100)') as [NT_Username],

    event_data.value('(event/action[@name="client_hostname"]/value)[1]',

    'varchar(100)') as [Client_Hostname],

    event_data.value('(event/action[@name="client_app_name"]/value)[1]',

    'varchar(100)') as [Client_Appname],

    event_data.value('(event/action[@name="sql_text"]/value)[1]',

    'varchar(1000)') as [sql_text],

    event_data.value('(event/action[@name="is_system"]/value)[1]',

    'varchar(5)') as [is_system],

    event_data.value('(event/action[@name="client_hostname"]/value)[1]',

    'varchar(100)') as [client_hostname],

    event_data.value('(event/action[@name="statement"]/value)[1]',

    'varchar(1000)') as [statement],

    event_data.value('(event/action[@name="duration"]/value)[1]',

    'bigint') as [duration],

    event_data.value('(event/action[@name="CPU_time"]/value)[1]',

    'bigint' ) as [CPU_time],

    event_data.value('(event/action[@name="physical_reads"]/value)[1]',

    'bigint' ) as [physical_reads],

    event_data.value('(event/action[@name="logical_reads"]/value)[1]',

    'bigint' ) as [logical_reads],

    event_data.value('(event/action[@name="writes"]/value)[1]',

    'bigint' ) as [writes],

    event_data.value('(event/action[@name="context_info"]/value)[1]',

    'int' ) as [context_info]

    from (select cast(event_data as xml)

    from sys.fn_xe_file_target_read_file('d:\log\SlowPerformance_0_132021868172130000.xel', null, null, null)

    ) as results(event_data)

    --where event_data.value('(event/action[@name="duration"]/value)[1]',

    --'int') >3000000

    order by [Event_Time_UTC]

    ExtendedEvent

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply