The following code snippet demonstrates one possible way to delete duplicate rows in a SQL Server table. This method requires the table in question to utilize an identity column. The table utilized in this example is named 'ExampleTable', has an identity column named 'ID' and 2 other columns named 'Column2' and 'Column3'. This particular example looks for records where 'Column2' and 'Column3' are identical for a particular row. This example could be extended by simply adding more column names to the group by clause or removing columns. The more columns in the group by clause the more precise the duplicate search will be. Depending on the usage this example will find records where a single column signifies a duplicate (remove a column from the group by clause in the below example) or in the case where multiple columns must be identical to signify a duplicate (as in the example below).
DELETE FROM ExampleTable
WHERE ID NOT IN
(
SELECT MAX(ID)
FROM ExampleTable
GROUP BY Column2, Column3
)