I have a table with 11000 rows (two columns are URN and date) and I want to add rows to it.
However if the URN is already there when adding the new rows, it should overwrite the previous record so the date is updated.
for example,
select urn, GETDATE() AS Date
into table1
from table2
if urn 10253 has date 23/05/2005 in table1 but the urn is in table2 then it should be replaces with urn 10253 date 10/10/2012
–Update all the matching records first
–Insert all the new records