I have two table in two different servers, but the servers are linked. I would like to compare Table A from one server and Table B from the other. If table B has a record that Table A does not have I would like to copy that record and insert it into Table A. I have tried to use Insert Into Select statements, but I cannot get it to execute. Any help would be appreciated. Thank you
I have tried to use Insert Into Select statements, but I cannot get it to execute.
INSERT INTO PHYSICAL_INVENTORY (ITEMKEY, ITEM_NUMBER, WHSE_BIN_KEY,
CONTROL_NUMBER)
SELECT T.ItemKey, I.ItemID, T.WhseBinKey, T.CtrlNo
from [Server B].prod.dbo.counttran T
inner join [Server B].prod.dbo.timItem I on I.ItemKey = T.ItemKey
Where ITEMKEY <> T.ItemKey