function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PseudodarwinistPseudodarwinist 

Duplicates were inserted in huge amount

Last night more than 1 million Accounts(Clients) were inserted in Salesforce by a batch job from ETL.So as a newbie i have two problems to solve now:
1.How to delete that big a volume of duplicates? What query should i use to retrieve them from Account object so that they don't time out?R1_ACC_TXT_Id_Golden_record__c is a field on my Account object which is a primary key.No two Clients can have same Golden record.
2.
How do i prevent such fiascos in future.Is there an inherent functionality in Salesforce to prevent it?Can i write a trigger?Generally a million record is updated every night so how do i write that trigger?

Any immidiate and elaborate response is appreciated.I am a newbie so a bit of consideration and elaboration will help me.
Michael EnoMichael Eno
Chetan, where are you located? Have you ever heard of demand tools? 
PseudodarwinistPseudodarwinist
I am located in Madrid, Spain.
Sorry i have not heard of Demand tools yet. I will google them. Can you be patient enough to share your two cents on Demand tools?