Reputation:
Is there a way to sniff SQL queries sent to a SQL Server db on any level (above transport level)? Perhaps there's some kind of a tracer in ASP.NET or built-in log in SQL Server ?
Upvotes: 8
Views: 14149
Reputation: 1390
When you are in SQL Management Studio, open the query editor and set it to the correct database you would like to profile. Run the following query:
select db_id()
That will tell you your database id .
Then click Column Filters and choose DatabaseID in the Edit Filter box.
On the right, choose "Equals" and put in the database id from the query above.
Upvotes: 5
Reputation: 7368
The tool your looking for is SQL Server Profiler, learn to use it and to love it.
Try starting with a filter on ApplicationName and/or HostName for your IIS server running your ASP.NET application. Profiler can get quite chatty.
Upvotes: 4
Reputation: 3725
SQL Server Profiler perhaps? This will pick up what queries are executed. You can also get statistics, query plans and many other items of interest from this.
Upvotes: 11