spikepl
Eledittingent Beliped
- Local time
- Tomorrow, 00:08
- Joined
- Nov 3, 2010
- Messages
- 6,142
I have a table tblDestination that I want to update.
I have data in tblSource. If SourceID exists in tblDestination, the values in that record should be updated. If not, then that record should be added, with a new PK.
I can do this in severals steps, no problemo. But I seem to recall there is a possibility to do all this in one go with some fancy Left linking etc. Am I wrong?
tblDestination
--------------
DestID (PK - autonumber)
SomeData (Text)
and
tblSource
-----------
SourceID (PK - long)
SomeSourceData (Text)
so with
tblDestination
---------------
DestID SomeData
1............text1
2............text2
and
tblSource
----------
SourceID SomeSourceData
1...............text25
7...............text46
end result is
tblDestination
--------------
DestID SomeData
1............text25
2............text2
3............text46
I have data in tblSource. If SourceID exists in tblDestination, the values in that record should be updated. If not, then that record should be added, with a new PK.
I can do this in severals steps, no problemo. But I seem to recall there is a possibility to do all this in one go with some fancy Left linking etc. Am I wrong?
tblDestination
--------------
DestID (PK - autonumber)
SomeData (Text)
and
tblSource
-----------
SourceID (PK - long)
SomeSourceData (Text)
so with
tblDestination
---------------
DestID SomeData
1............text1
2............text2
and
tblSource
----------
SourceID SomeSourceData
1...............text25
7...............text46
end result is
tblDestination
--------------
DestID SomeData
1............text25
2............text2
3............text46