I want to get count of all records stored in Extended Event but that file is a huge and running a query on it takes several minutes and does not meet my need. I wanted to know is there any place in the sql server to get this data there? I mean something like sys.traces or event_count
I write query but this is not work
SELECT COUNT(timestamp_utc)
FROM sys.fn_xe_file_target_read_file(N'D:\Extended Event\ErrorReport\ex_*.xel', NULL, NULL, NULL);
You can export it to csv file as, it is explained in this link
Then, you can import the csv file into a sql server using Bulk insert
Bulk insert execution is very fast unless you don't use indexes in the target Table, see here
Then you can query the SQL SERVER Table to which you imported the Data.