• Cool - love it 🙂

    Although - it still suffers from the problem of deleting potentially valuable data 😉

    this solves it:

    with Dups as

    (SELECT *,row_number()

    OVER

    (partition by id,col1 order by id,col1) as RowNum

    FROM duptable

    )

    Malcolm
    DB Ghost - Build, compare and synchronize from source control = Database Change Management for SQL Server
    www.dbghost.com