How to delete audit logs in older Litium versions Q&A

Use this query on a local DB first and try out:

DELETE Auditing.AuditTransaction FROM 
Auditing.AuditTransaction AT
JOIN 
Auditing.AuditTransactionItem ATI
ON
AT.SystemId = ATI.AuditTransactionSystemId
WHERE 
AT.TransactionDateTimeUtc < DATEADD(MONTH,  -3 , GETDATE())
AND
ATI.EntityType <> 'Litium.Security.AuthenticationService, Litium.Abstractions'

“-3” = Month back in time you want to delete
It will not delete Authentication rows.
Remember to restart the Application pool after.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.