Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6940599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:46:25+00:00 2026-05-27T12:46:25+00:00

In my web application I would like to make a response-test process. This process

  • 0

In my web application I would like to make a “response-test” process. This process can be launched from a web page to see if the Database server is reachable and the approximative time to get some results.

I don’t want precise time of the execution of the stored procedure, I would like to have an idea of the “reactivity” of the Database..

So I make a method like this :

        var start = DateTime.Now;
        var test = new ObjectManager().ListObjects(SomeParameters);            
        var stop = DateTime.Now;
        TimeSpan diff = stop - start;
        label.Text = diff.TotalSeconds.ToString();

In facts the ObjectManager.listObject() is a method who get some datas from database throught a stored procedure.
So the time is calculated for all the process.
Contacting the database, launch stored procedure, cast and retrieve the datas, ..
Not only for the stored procedure. This is not a problem.

This works fine, but I have two problems.

  1. I need to make a stored procedure “independent” from quantities of
    datas.

  2. I noticed that at the first execution the time returned is for
    exemple 1,62123 seconds. And if I refresh the page the time is
    0,89897 seconds.. Half time! after that each refresh is around 0,8
    secs..

It seems it is caused by sql cache..

So, I need a stored procedure ‘independent’ from quantities of data’s in the Database and which don’t use the sql cache.. Any idea to do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:46:26+00:00Added an answer on May 27, 2026 at 12:46 pm

    You can create a procedure which contains some SQL code that returns a static value. Like SELECT 1; or SELECT getdate()

    That way you check the connection to your database without hitting any data.

    The first time you run the procedure the SQL server will need to make a plan for it, that will cause some overhead.

    Of course you can always run the procedure several times in a row (from code) and calculate an average.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to make the update of the web application as automated as
I have this idea for a small-medium web application that I would like to
I would like to make a web application (PHP) that will have overlay container
I would like to make a web application with a responsive design to post
I'm building a web application, and I would like to make certain functions on
For my web-application I would like to add an object before another object inside
I am working on a web application and we would like to capture the
I have a ASP.NET 3.5 web application and I would like to allow users
I would like a web application to learn things about its environment so that
I would like to implement asynchronous email sending in my web application when users

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.