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

  • 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)