Finding duplicate contact2 entries

These can lie undetected for years, and only become apparent when you run a Crystal Report, or you might see multiple results for the same record come up in the Contact Search Centre.

To see if you have any, just run this query:

select accountno, count(accountno) from contact2 group by accountno order by count(accountno) desc

This will show you all of the account numbers in your system, and how many contact2 records exist for each. Ideally, there sould be a ‘1’ next to each. The list is sorted by the number of contact2 records against each account in descending order, and so duplicates (or it may be triplicates, quintipulates or even more) will appear at the top of the list.

Getting rid of them involves delving into SQL itself, or you can use a tool like GoldBox to merge them.