How to monitor just t-sql commands in SQL Profiler?

只愿长相守 提交于 2019-11-28 07:31:36

问题


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?


回答1:


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), 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.

  • How to: Filter Events in a Trace
  • Using SQL Server Profiler



回答2:


Download Express Profiler From CodePlex

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




回答3:


  • 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.


来源:https://stackoverflow.com/questions/18669421/how-to-monitor-just-t-sql-commands-in-sql-profiler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!