Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No of calls made from the ASP to the Database

Status
Not open for further replies.
Oct 11, 2006
300
US
Is there a way I can see how many database calls were made from my script to the db server to check how well my SQL queries are formed? I get the time taken to execute the queries, but in that time taken, I want to know how many calls were made to the DB server. Is it possible?

Thanks.
 
One way would be to add a table with an identity field to your database and, for each time it is accessed, increment it one. You would likely need to write the SQL code to update the table each time it is accessed.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
If you are using Microsoft SQL Server you can turn on a trace by using the "Profiler" tool.

Start -> Programs -> Microsoft SQL Server -> Profiler
 
I cannot modify the tables. That is not an option for me.

If I am to use the Profiler, what am I supposed to do now. This Profiler looks new to me. What options am I supposed to use?

For instance with 1 asp page, I call 2 tables - AMP and Employee

So how do I know how many calls were made from the web application?

Thanks.
 
I ran a trace on the SQL Server 2005, but what do I make out of these columns?

Reads, Writes, Duration

Which column would tell me how many times were the calls made? I do not want the duration. I want the number of calls made.

Thanks.
 
Go into the Profiler and click: File -> New -> Trace

Now pick your server and then a box comes up, it is pretty easy to figure out... look on the Events tab and scroll down to find the TSQL events for executing a qurey and make sure they are included in the trace.

If you want to see the results over time then you could have it write to a log file and let it run all day but make sure you turn it off since there will be a slight performance hit during the trace.

If you just want to run a few pages and see what happens you could just watch it in real-time on the screen without saving to a file but again remember to turn it off when you are done.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top