
select p.name package_name, o.name event_name, c.name event_field, 
       c.type_name field_type, c.column_type column_type
from sys.dm_xe_objects o
join sys.dm_xe_packages p
      on o.package_guid = p.guid
join sys.dm_xe_object_columns c
      on o.name = c.object_name
where o.object_type = 'event'
order by package_name, event_name

-- customizable or data event fields
-- these are: MDAuditId, collect_call_stack, collect_path, collect_io_data
select p.name package_name, o.name event_name, c.name event_field, 
       c.type_name field_type, c.column_type column_type
from sys.dm_xe_objects o
join sys.dm_xe_packages p
      on o.package_guid = p.guid
join sys.dm_xe_object_columns c
      on o.name = c.object_name
where o.object_type = 'event' 
and (c.column_type = 'customizable' or c.column_type = 'data')
and o.name = 'error_reported' 
order by package_name, event_name

-- customizable event fields
-- these are: MDAuditId, collect_call_stack, collect_path, collect_io_data
select p.name package_name, o.name event_name, c.name event_field, 
       c.type_name field_type, c.column_type column_type
from sys.dm_xe_objects o
join sys.dm_xe_packages p
      on o.package_guid = p.guid
join sys.dm_xe_object_columns c
      on o.name = c.object_name
where o.object_type = 'event' 
and c.column_type = 'customizable'
-- and o.name = 'error_reported' 
order by package_name, event_name