Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Hello Kenneth. When you say a trace you mean running the SQL Profiler, don't you? If that's the case I would need more information about how to capture this concrete query. I've played with it sometimes just for fun, but really didn't need it on a real situation. Thanks!! Commented Jul 10, 2013 at 7:38
  • SQL Profiler is the GUI for traces yes. From what you said the query you are trying to capture is a "problem" query. If so it has a high duration, high reads, high writes etc. Your query above will give you the minimum reads & duration for your query, and you can add in writes fairly easily. Create your trace using that information (along with the specific database you are using) as your filters. That will capture more than just the query you are interested in but hopefully not a great deal more. I'll try to script an example out and add it to my answer. Commented Jul 10, 2013 at 12:44
  • Hello Kenneth, your script really works great. I'm still playing around with it but the results seen reveal interesting queries to improve. Thanks !! Commented Jul 11, 2013 at 7:54