Loic Loic - 5 months ago 3x
SQL Question

The multi-part identifier "Export_Web_Shipping.site_num" could not be bound

I am getting the following error "The multi-part identifier "Export_Web_Shipping.site_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 Web_Shipping
SET Web_Shipping.site_num= Export_Web_Shipping.site_num
FROM Web_Shipping a, Export_Web_Shipping b
WHERE b.[web_order_id]= a.web_order_id


You gave Export_Web_Shipping an alias b. So use b and not Export_Web_Shipping.
Also, I would use a join.

SET a.site_num = b.site_num
FROM Web_Shipping a JOIN Export_Web_Shipping b 
ON b.[web_order_id]= a.web_order_id