• ghanshyam.kundu (9/27/2011)


    i am completely agree with jeff. and manipulating the query as per him

    UPDATE p

    SET Part_Cost = I.Vendor_Cost

    FROM PART p inner join Part_Supplier PS on p.partid=ps.partid

    INNER JOIN Inventory I on I.Part_Id = PS.Part_Id

    I'm pretty sure that still won't account for the fact that there could be more than one cost depending on the vendor associated with inventory. It's not your fault... there's just not enough information given for this problem to solve it correctly.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)