SQL Server activity monitor show all queries

丶灬走出姿态 提交于 2020-03-18 03:14:09

问题


I'm using SQL Server 2005, and I'd like to know if there is any possibility to watch every query sent to SQL server?

SQL Server Management Studio has a built-in tool called the Activity Monitor which gives me nearly what I am searching for in the "Recent Expensive Queries Pane"

This pane shows information about the most expensive queries that have been run on the instance over the last 30 seconds.

I need exactly this for all recent queries, not just the expensive ones...

Can anyone help me?

Name a tool, or give me a hint what to search for...


回答1:


To watch every query sent to SQL server using SQL profiler, you can use one of SQL Profiler predefined templates. It's TSQL_Duration.

It's designed to track completed stored procedures and TSQL code.

The trace will show you exactly the batch executed.

You can expand the events tracked and columns shown.You can find more information here: How To: Use SQL Profiler

The same feature is also available in ApexSQL Comply, an auditing tool that uses SQL traces to capture the events, then stores them in a central repository database, and provides built-in and custom reports where you can easily filter the transactions, and export them as Excel, Word, or PDF files.

Disclaimer: I work for ApexSQL as a Support Engineer


回答2:


You're looking for SQL Profiler, it's usually installed along with SSMS.



来源:https://stackoverflow.com/questions/10912723/sql-server-activity-monitor-show-all-queries

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