Where to find sql server query cost

Posted on 2011-10-25
Last Modified: 2012-06-27
Hi Expert,

I run the query from exam 433 book, it said this query cost is 151, where I can find this number? Thanks in advance.

USE AdventureWorks;

        SELECT TOP(1)
        FROM Sales.SalesOrderDetail AS sod1
        WHERE sod1.SalesOrderID = soh.SalesOrderID
        ORDER BY sod1.OrderQty DESC
    ) AS UnitPrice
        SELECT TOP(1)
        FROM Sales.SalesOrderDetail AS sod2
        WHERE sod2.SalesOrderID = soh.SalesOrderID
        ORDER BY sod2.OrderQty DESC
    ) AS OrderQty
FROM Sales.SalesOrderHeader AS soh
WHERE soh.TerritoryID = 4;
Question by:dshi15
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    please see this page to learn about how to start debugging queries in terms of performance:
    LVL 1

    Author Comment

    the page you sent is outdated, could you just point out where to click to check cost number?
    LVL 142

    Accepted Solution

    sorry, although the sql 2000 basics are still transposable into sql 2005/2008

    ok, let's see, here a more update article about using explain plans, which include the cost:

    this said, not sure what the book actually means about this "cost being 151 ...


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    758 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

    11 Experts available now in Live!

    Get 1:1 Help Now