How can I see the SQL statements executed against my localdb database?

I run LocalDB to develop my application and would like to see SQL statements that are executed by my application from its various components. Is there a tool that I can use to capture these statements?

+6
source share
2 answers

If you are using SQL Server Management Studio for SQL 2008 or SQL 2008 R2, you have a tool called Activity Monitor that allows you to see what queries are running in your database, as well as statistics details of the cost it has for dbms. You can simply right-click on the server (as soon as Mgmt Sutdio opens), select “Activity Monitor” and see the “Recent Costly Requests” section at the end of the application. Good luck.

+1
source

Let me listen to two very lightweight Sql profilers that can do the job for various SqlServer variants, including LocalDb - "worked on my machine (TM)"

Expressprofiler

Today, the easiest way is to use one (as well as the simplest code-show-me-the-SQL-statements-thanks) ExpressProfiler on CodePlex .

enter image description here

And the whole program is the only 126 KB EXE! Now this one is easy!

AnjLab Sql Profiler

Another one is the DataWizard , which used to be free (prices now start at $ 5).

Someone managed to save a snapshot on GitHub (including xcopy-installable binaries) when it was open source.

The executable file is an "AnjLab Sql Profiler" and allows you to filter the displayed events, but this strength is also its weakness, since there are many types of events that can be turned on / off. If everything is selected, the output will be pretty detailed.

Remote output can only be obtained by selecting specific events.

enter image description here

The following are the events that I chose to get the above output:

enter image description here

+3
source

All Articles