Home Forums SQL Server 2005 Administering Get rid of duplicate records in a table using SQL Server 2005 RE: Get rid of duplicate records in a table using SQL Server 2005
Steve-3_5_7_9
SSChampion
Points: 10832
More actions
June 18, 2010 at 8:27 am
#1182162
How about:
Insert into tblModels (Column1,Column2,Column3,Column4,...)
SELECT
n.COL1, n.COL2, n.COL3, n.COL4, ...
FROM tblReceivedData n
where
NOT EXISTS
(SELECT o.col1, o.col2 from tblModels o
where n.col1 = o.col1
and n.col2 = o.col2)