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

bsh152s picture bsh152s · Mar 15, 2010 · Viewed 148.1k times · Source

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.

Answer

Benjamin Ortuzar picture Benjamin Ortuzar · Mar 15, 2010

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