Link to home
Start Free TrialLog in
Avatar of Anthony Cardullo
Anthony CardulloFlag for United States of America

asked on

update table with 2 variable inputs

i need  procedure that updates a tracking field.
I will pass two values to the procedure.
  is the SOOrders.SONumber and the 2nd value is the tracking number

I find the right record by doing a join as shown below but am not qiute sure to to create the update statement.

Thank you


      @SONumber varchar(15) = null,
      @TrNumber varchar(1024) = null
AS




      

SELECT     SOShipments.ShipmentNumber, SOShipments.TrackingNumbers, SOOrders.SONumber
FROM         SOShipments INNER JOIN
                      SOFulfills ON SOShipments.FulFillID = SOFulfills.FulfillID INNER JOIN
                      SOOrders ON SOFulfills.SOID = SOOrders.SOID
                      --where ShipmentNumber = 'S1000016'

BEGIN

UPDATE SOShipments
SET TrackingNumbers = @TrNumber
where SOOrders.SONur = @SOnumber
END
ASKER CERTIFIED SOLUTION
Avatar of Russ Suter
Russ Suter

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
Avatar of Anthony Cardullo

ASKER

Thats it?  duh.  lol.

Thank very much.

~Anthony