View Contents of Audit Files
The audit file generated by SQL Server is in binary format and can be viewed through the SQL Server built-in function fn_get_audit_file. The specific steps are as follows:
- Download the audit result file to the server where SQL Server is installed. Note that the SQL Server of high version can be compatible with the audit file of low version, but SQL Server of lower version cannot be compatible with audit file of high version. For example, users can view the audit files generated by 2014, 2012 and 2008R2 in SQL Server 2014, but cannot view the audit files in 2016.
- Connect to the master database.
- Execute the following SQL (assuming the audit file is ‘D:\audit\RDSAudit_131702498897960000.sqlaudit’).
select * from sys.fn_get_audit_file('D:\audit\RDSAudit_131702498897960000.sqlaudit',NULL, NULL)
- Detailed SQL syntax and query results can be found in the following Microsoft official documents: