SQL Server activity monitor show all queries

BigM picture BigM · Jun 6, 2012 · Viewed 46.5k times · Source

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

Answer

Milena Petrovic picture Milena Petrovic · Jun 21, 2014

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

enter image description here

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

enter image description here

The trace will show you exactly the batch executed.

enter image description here

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.

enter image description here

enter image description here Disclaimer: I work for ApexSQL as a Support Engineer