question

Sagar Bhargava avatar image
Sagar Bhargava asked

Automate SQL Server 2008 profiler?

Hi, I have scripted out a trace file which I want to use in a batch file. The functionality needed is to run the batch file to start the trace and the trace should end after running for a couple of minutes. Any Ideas??
profiler
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kev Riley avatar image
Kev Riley answered
Christina Leo presented something along these lines at SQLBits9. Slides and demos available at
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Christina Leo avatar image
Christina Leo answered
Hey Sagar, Here is a link for the script I use for a timed trace. You can modify to stop time to capture the time period you need. In addtion to editing the event classes and columns you want to monitor you might want to exclude the filter on the specific database. Let me know if you have any questions. [T-SQL Code for Timed Profiler Trace][1] [1]: http://bit.ly/TimeTraceScript
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

+1 thanks for stopping by. Great presentation by the way!
2 Likes 2 ·
Thanks Kev! Hoping to get another chance to present at SQLBits 10.
0 Likes 0 ·
Hope you manage to get there,it would be great to see you again.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.