Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samirbehara-zz/72b8cdc5b1cefb167083e42042baa6de to your computer and use it in GitHub Desktop.
Save samirbehara-zz/72b8cdc5b1cefb167083e42042baa6de to your computer and use it in GitHub Desktop.
List of all Security Audit Events from SQL Default Trace
--List all Security Audit Events
DECLARE @id INT;
SELECT @id = id
FROM sys.traces
WHERE is_default = 1;
SELECT DISTINCT eventid AS 'EventID' ,
name AS 'Event Name'
FROM fn_trace_geteventinfo(@id) GEI
JOIN sys.trace_events TE ON GEI.eventid = TE.trace_event_id
WHERE name LIKE '%Audit%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment