Skip to main content

How to find the duplicate rows in a table using sql script?

Posted in

Here is the SQL Script to find the duplicate rows in a table in SQL Server

This Script will give you the count of the number of the times the records are repeated in the column.
select ColumnName, count(ColumnName) as MoreThan1 from TableName
Group by ColumnName Having (count(ColumnName) > 1)

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Syntax highlight code surrounded by the {syntaxhighlighter OPTIONS}...{/syntaxhighlighter} tags.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.