Reputation: 123
I am getting the following error "The multi-part identifier "Export_Shipping.s_num" could not be bound.". My target table is web_shipping and the source is export_web_shipping. How to fix this specific Update query ?
UPDATE Shipping
SET Shipping.s_num= Export_Shipping.s_num
FROM Shipping a, Export_Shipping b
WHERE b.[order_id]= a.order_id
Upvotes: 1
Views: 136
Reputation: 39457
You gave Export_Shipping
an alias b
. So use b
and not Export_Shipping
.
Also, I would use a join
.
UPDATE a
SET a.s_num = b.s_num
FROM Shipping a JOIN Export_Shipping b
ON b.[order_id]= a.order_id
Upvotes: 1