Skip to content

Instantly share code, notes, and snippets.

@hoangitk
Created September 4, 2014 08:48
Show Gist options
  • Select an option

  • Save hoangitk/9ba5e1c06b3f86b2d69b to your computer and use it in GitHub Desktop.

Select an option

Save hoangitk/9ba5e1c06b3f86b2d69b to your computer and use it in GitHub Desktop.
query data from sql profiler trace file
SELECT TextData, Duration/1000/60 [Duration (m)], Reads, Writes, CPU, StartTime
FROM fn_trace_gettable('F:\RestoreDB\HR 4.3.1\TSG01\TSG01_aCao.trc',1)
where 1=1
-- and Duration > 10000 -- over 10s
and textdata is not null
-- and textdata LIKE N'%sp_replcmds%'
order by duration desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment