Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I view executed queries within SQL Server Management Studio?

I am new to SQL Server Management Studio and am wondering: is there is a way to see which queries have been run against a database?

In the Activity monitor, there is a "Recent Expensive Queries" report but I'm guessing that isn't all of the queries since I'm not seeing the ones I have run.

I am running SQL Server Express 2008 v 10.0.1600.22.

like image 720
bsh152s Avatar asked Mar 15 '10 18:03

bsh152s


People also ask

How do I view query history in SQL Server Management Studio?

Using SQL Server Management Studio In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance. Expand SQL Server Agent, and then expand Jobs. Right-click a job, and then click View History. In the Log File Viewer, view the job history.

How do I display SQL queries?

The syntax is: DISPLAY; The DISPLAY command must be placed immediately after the query statement on which you want it to take effect.


1 Answers

Use SQL Profiler and use a filter on it to get the most expensive queries.

like image 103
Benjamin Ortuzar Avatar answered Sep 27 '22 17:09

Benjamin Ortuzar