I have table 1 with columns
- RunID
- SeqNo_In_Run
- PrimitiveID
I have table2 with columns
- RunID
- SeqNo_In_Run
- some other columns
(RunID and SeqNo_In_Run) is the primary key in both tables
I want to add the PrimitiveID column to table 2 where RunID and seqno_in_run matches for every row.
I followed this answer and have written something like this:
update GPS_Snapped
set GPS_Snapped.PrimitiveID = GPS_Snapped_New.PrimitiveID
from GPS_Snapped
inner join GPS_Snapped_New
on GPS_Snapped.RunID=GPS_Snapped_New.RunID and
GPS_Snapped.SeqNo_In_Run=GPS_Snapped_New.SeqNo_In_Run
where GPS_Snapped.RunID=GPS_Snapped_New.RunID and
GPS_Snapped.SeqNo_In_Run=GPS_Snapped_New.SeqNo_In_Run
but it is giving me the error near set GPS_Snapped.PrimitiveID
that invalid column name PrimitiveID
but I have added a new column PrimitiveID to GPS_Snapped and if i do simple update(like update table set col1 = val where condition) it's working fine. Can you help me what's wrong with my script.