Link to home
Start Free TrialLog in
Avatar of dshi15
dshi15Flag for United States of America

asked on

Where to find sql server query cost

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
    soh.SalesOrderID
    ,soh.OrderDate
    ,(
        SELECT TOP(1)
            sod1.UnitPrice
        FROM Sales.SalesOrderDetail AS sod1
        WHERE sod1.SalesOrderID = soh.SalesOrderID
        ORDER BY sod1.OrderQty DESC
    ) AS UnitPrice
    ,(
        SELECT TOP(1)
            sod2.OrderQty
        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;
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

please see this page to learn about how to start debugging queries in terms of performance:
http://msdn.microsoft.com/en-us/library/ff650689.aspx
Avatar of dshi15

ASKER

the page you sent is outdated, could you just point out where to click to check cost number?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial