Number of total select statement for particular web page?

I was wondering what is the easiest way to see total number of database queries from my ASP.Net (.NET 2.0) application.

My application heavily use sql 2005 database because all data are dynamic and everything goes through one connection string in web.config. Connection pooling is enabled there.

  • chronological comparisons within rows in T-SQL
  • Combining Entity Framework SqlQuery with extra restriction in code
  • How to EXECUTE dynamic query in WITH clause in SQL Server
  • Is it possible to generate generate thiessen (Voronoï) polygons using the SQL Server Spatial datatypes?
  • Passing select datename() result to stored procedure
  • Why the output parameter of my ADODB.Command does not retrieve a value when executing?
  • So, I am wondering how many select statements are executed for particular page I load in my browser.

    I don’t care if I can see that information from .net side or from db side as long as I can see only connections to MY database. Not all connections to that db server because I use shared db server and there is a lot of other databases.

  • Stored Procedure return multiple result sets
  • How to find the total between the dates for each values
  • Database trigger to update a row on parent table after child table has been updated
  • Security risks of setting trustworthy = on in sql server 2012
  • SQL Server 2008 connection error
  • problem with
  • 6 Solutions collect form web for “Number of total select statement for particular web page?”

    The best way to do this is to set up a profiler on your database and then make a single request to your ASP.NET application. The profiler will aggregate any data you wish and you will be able to use that data to determine what queries were sent to SQL Server from your application.

    The SQL Server Profiler will list all actions performed on your DB. If you use a different db login name for your project (probably a really good idea if you are not) you can filter so it only shows actions from your login (see Events Selection, Column Filters then Login Name).

    Use SQL Profiler. You can configure it to filter by the database you want and to just show select statements.

    If you have some sort of database layer in your code, you could modify it to write out a log message every time you run a select statement. Then just load the page once and count the number of log statements. This may or may not work, depending on how your code is structured, but it’s an option.

    Edit: I misread the question. I thought you had multiple clients connecting to the same database, not the same database server. In that case, a profiler probably is the best choice.

    Do you have access to SQL Server Profiler? You can set up traces to monitor this sort of thing by loading a page and looking at the effects in the profiler.

    JUst be aware that Profiler can affect performance, so it is best to do this on dev.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.