Reputation: 2120
Is it possible to Clear SQL Server
Audit File logs. I want to delete old logs by date but can't find a way to delete it both from interface and sql Query.
Upvotes: 0
Views: 6579
Reputation: 1
Make sure that file is not in use by:
Then from properties, you can limit number of files and max number of lines inside each audit log file.
Upvotes: 0
Reputation: 3568
Yes, it is.
By sys.server_audits select old names via create_date
column.
Then loop the names and delete them by using the next code for deleting:
ALTER SERVER AUDIT [Audit_name] WITH (STATE = OFF)
GO
USE [master]
GO
DROP SERVER AUDIT [Audit_name]
GO
Upvotes: -1