Loic Loic - 2 years ago 66
SQL Question

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

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

Answer Source

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  
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download