Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server activity monitor show all queries

Tags:

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

like image 672
BigM Avatar asked Jun 06 '12 10:06

BigM


2 Answers

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 hereDisclaimer: I work for ApexSQL as a Support Engineer

like image 143
Milena Petrovic Avatar answered Oct 25 '22 09:10

Milena Petrovic


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

like image 24
Pondlife Avatar answered Oct 25 '22 10:10

Pondlife