With help, the Upsert code below now works.
The structure of both tables is exactly the same.
We plan on using the upsert code for some tables that will have over one hundred compounds (PFOS, PFOA, ...)
Rather than go line by line, is there a way to set the equivalencies for each individual field?
Current Code that would end up having lots of lines:
Code:
UPDATE tblTemp
LEFT JOIN dbo_tbl537 ON tblTemp.LabID = dbo_tbl537.[LabID]
SET
dbo_tbl537.LabID = tblTemp.[LabID],
dbo_tbl537.[Date] = tblTemp.Date,
dbo_tbl537.PFOS = tblTemp.PFOS,
dbo_tbl537.PFOA = tblTemp.PFOA,
dbo_tbl537.PFHxS = tblTemp.PFHxS,
dbo_tbl537.PFNA = tblTemp.PFNA;
What I want to do that doesn't work:
Code:
UPDATE tblTemp
LEFT JOIN dbo_tbl537 ON tblTemp.LabID = dbo_tbl537.[LabID]
SET
dbo_tbl537.* = tblTemp.* ;
Thanks for looking.