Please visit our sponsor
UNKNOWN --************************************** -- Name: FindDupes -- Description:Allows you to determine duplicate rows in a table and provide a count of the duplicates. It's helped me find a row or two that had left me with "inconclusive" results in the past : ) Ciao; Greg -- By: Greg -- -- -- Inputs:None -- -- Returns:None -- --Assumes:Limiting the columns provides field level duplicate finds.. Using all columns will give a row level duplicate find. -- --Side Effects:None --This code is copyrighted and has limited warranties. --Please see http://www.Planet-Source-Code.com/xq/ASP/txtCodeId.247/lngWId.5/qx/vb/scripts/ShowCode.htm --for details. --************************************** SELECT column1, column2, column3, ... n, COUNT(*) AS [Number of Dupes] FROM TableName GROUP BY column1, column2, column3... n HAVING COUNT(*) > 1