Relational update

  • How to update via SQL 2000 if i have situation like this?

    update payment set Payment.OrderNo=Salesorder.OrderNo where

    Payment.OrderNo=Salesorder.InvoiceNumber

    Thanks for help

    Dwen

  • That's an interesting update. I'd make sure that this was right, but here is how you'd write that:

    UPDATE P

    SET OrderNo = S.OrderNo

    FROM Payment P

    INNER JOIN SalesOrder S ON P.OrderNo = S.InvoiceNumber

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply