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/08a4f3fd1570cea4ffd0391f64635bd0 to your computer and use it in GitHub Desktop.
Save samirbehara-zz/08a4f3fd1570cea4ffd0391f64635bd0 to your computer and use it in GitHub Desktop.
DECLARE @tracefile VARCHAR(256)
SELECT @tracefile = CAST(value AS VARCHAR(256))
FROM ::fn_trace_getinfo(DEFAULT)
WHERE traceid = 1
AND property = 2 -- filename property
SELECT *
FROM ::fn_trace_gettable(@tracefile, DEFAULT) trc
INNER JOIN sys.trace_events evt ON trc.EventClass = evt.trace_event_id
WHERE trc.EventClass IN (102, 103, 104, 105, 106, 108, 109, 110, 111)
ORDER BY trc.StartTime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment