Created
January 20, 2020 00:09
-
-
Save CaledoniaProject/624da6ad6b2a5079382f0a7fc1b16882 to your computer and use it in GitHub Desktop.
SQLServer dump audit specifications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT [sa].[name] as audit_name, [sas].[name] as audit_spec_name, [sasd].[audit_action_name] as action, [dp].[name] as username, [o].[name] as tablename | |
FROM sys.server_audits sa | |
JOIN sys.database_audit_specifications sas ON sa.audit_guid = sas.audit_guid | |
JOIN sys.database_audit_specification_details as sasd ON sas.database_specification_id = sasd.database_specification_id | |
JOIN sys.database_principals dp ON dp.principal_id = sasd.audited_principal_id | |
JOIN sys.objects o ON o.object_id = sasd.major_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment