SQL Server Query Performance Test

Posted on 2012-08-14
Last Modified: 2012-08-20
Hello Experts,

I have created an application using ASP.NET and SQL Server as my DB. I was wondering how I could test the speed of my queries and also how I can determine what a good query speed should be.

I'm knew to testing queries in SQL so please be patient :)

I want to be proactive and make sure that my queries are fast and not slow.
Question by:asp_net2
    LVL 10

    Accepted Solution

    LVL 4

    Expert Comment

    With ASP you can do something similar to the following:

        DateTime startTime = DateTime.Now;
        /* YOUR QUERY. */
        DateTime stopTime = DateTime.Now;
        TimeSpan executionTime = stopTime - startTime;

    Open in new window

    the value of the executionTime variable is your query execution time which you can display or do with as you please.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
    Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
    Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now