SQL Server Performance

Update query

Discussion in 'SQL Server 2005 General Developer Questions' started by ralph1972, Nov 11, 2007.

  1. ralph1972 New Member

    I want to write an update query for the following :
    Table A :
    Field ARTID QTY
    Table B
    Field InventID, ArtID, QTYProgram, QtyStock
    I want to write an update query which update Table A field QTY with the difference from QtyStock - QtyProgram for the same ARTID and where InventID is a parameter.
    Is there anyone who can help me?
    Thanks in advance
  2. ndinakar Member

    A.Qty = B.QtyStock - QtyProgramFROM
    TableA AJOIN
    Table B ON A.ArtID = B.ArtId

Share This Page