UPDATE [cart]
SET [cart].item_id = [linked_server].[database].[dbo].[linked_cart].item_id
FROM [linked_server].[database].[dbo].[linked_cart]
INNER JOIN [products] ON [cart].product_id = [products].product_id
WHERE [linked_server].[database].[dbo].[linked_cart].sales_id = 'ABC'
AND [linked_server].[database].[dbo].[linked_cart].product_name = [products].product_name
AND [linked_server].[database].[dbo].[linked_cart].line_id = [cart].line_id
It's complaining when I give the full path to the linked server, and the table Cart
in the INNER JOIN
line. The error is
The multi-part identifier [cart].product_id could not be bound.
It also does this for the linked server tables.
Is there a workaround? The error does go away if I remove the identifiers, but then it changes ALL rows in Cart
because of ambiguity I'm guessing.