;WITH CTE AS (
SELECT ROW_NUMBER() OVER(PARTITION BY Column1,Column2 ORDER BY Column3) AS RowID
,*
FROM dbo.TableName (NOLOCK)
)
DELETE x
--SELECT Count(*)
FROM cte x
WHERE RowID > 1
SELECT ROW_NUMBER() OVER(PARTITION BY Column1,Column2 ORDER BY Column3) AS RowID
,*
FROM dbo.TableName (NOLOCK)
)
DELETE x
--SELECT Count(*)
FROM cte x
WHERE RowID > 1