Если вы хотите избежать вставки повторяющихся строк, попробуйте следующее:
INSERT INTO database2..myTable2 (C2, C3)
select t1.c2, t1.c3
FROM [database1]..[table1] t1
LEFT JOIN [database2]..[table2] t2 ON t1.C2 = t2.C2 and t1.C3 = t2.C3
where t2.c2 is null and t2.c3 is null
order by t1.C1
Если вы в порядке с дубликатами, то решение уже упоминалось Анджело.
Я пробовал с помощью tempТаблицы и рабочий код ниже:
IF (OBJECT_ID('tempdb..#myTable1') IS NOT NULL)
BEGIN
DROP TABLE #myTable1
END;
IF (OBJECT_ID('tempdb..#myTable2') IS NOT NULL)
BEGIN
DROP TABLE #myTable2
END;
CREATE TABLE #myTable1 ([C1] int identity(1,1), [C2] varchar(10), [C3] varchar(10));
CREATE TABLE #myTable2 ([C1] int identity(1,1), [C2] varchar(10), [C3] varchar(10));
Insert INTO #myTable1(C2, C3)
values
('Name 1', 'Address 1')
, ('Name 2', 'Address 2')
, ('Name 3', 'Address 3')
, ('Name 4', 'Address 4')
Insert INTO #myTable2(C2, C3)
values
('Name 11', 'Address 11')
, ('Name 12', 'Address 12')
, ('Name 13', 'Address 13')
, ('Name 14', 'Address 14')
select * from #myTable1
select * from #myTable2
INSERT INTO #myTable2 (C2, C3)
select t1.c2, t1.c3
FROM [#myTable1] t1
LEFT JOIN [#myTable2] t2 ON t1.C2 = t2.C2 and t1.C3 = t2.C3
where t2.c2 is null and t2.c3 is null
order by t1.C1
select * from #myTable2