How to clear SQL Server Extended Events Event File

By default the path seems like it would be

C:\Program Files\Microsoft SQL Server\MSSQLXX.MSSQLSERVER\MSSQL\Log\*.xel

or basically wherever the system files are kept for SQL Server (i.e. the default ERRORLOG location). If there is nothing there then it may be that your Extended Event is set to ring buffer in which case only the latest information is kept and it's stored in memory. Seems the only way to clear the log in this case would be to stop and start the session.


You can also use

DECLARE @SQLDataRoot VARCHAR(400)
EXEC master..xp_instance_regread @rootkey = 'HKEY_LOCAL_MACHINE', 
 @key = 'SOFTWARE\Microsoft\MSSQLServer\Setup', 
 @value_name = 'SQLDataRoot', @value = @SQLDataRoot OUTPUT
 SELECT @SQLDataRoot