• This is what i would use in such a case.

    select col1,col2  into #abc from tbl

    group by col1, col2

    having count(*) > 1

    delete tbl

    from #abc

    where tbl.col1 = #abc.col1 and tbl.col2 = #abc.col2

    insert tbl

    select * from #abc

     

    -- Amit


    -- Amit



    "There is no 'patch' for stupidity."



    Download the Updated SQL Server 2005 Books Online.