Question

I have a trouble in monitoring t-sql commands, I want to monitor just commands like: select, insert, update or delete. Can anyone help me?

Was it helpful?

Solution

Pick a trace template (such as Tuning) and use a filter.

Either filter by a particular login (such as your own login or a service's login), or a particular database.

For instance, to filter by database: Under Trace properties -> Events tab -> Select show all columns. Set a Like filter on database name.

I find setting a filter on the number of Logical Reads of say > 10 reads, filters out most of the noise.

OTHER TIPS

Download Express Profiler From CodePlex

You can get all your query after starting a trace. This can be used any machine.

  • Open Sql Profiler from: Programs -> Microsoft SQL Server 2008 R2 -> Performance Tools -> SQL Server Profiler
  • Click on "New Trace" and Logon into database engine
  • Click on "Show all events" checkbox
  • In the events tree expand "TSQL" and check SQL:BatchCompleted, then check "Show all columns" and check item "TextData"
  • Click Run button.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top