+ Start a Discussion
Rajiv B 3Rajiv B 3 

Account owner chagne error :: Too many query rows: 50001

While changing account owner encountering Error :: Too many query rows: 50001

I have gone through many post they are suggesting to change script means adding limit to the query.

Here in my class there is no chance to change the query and query not inside the for loop. 

for suppose if i Put Limit clause what about records which count more than 50000.  

For example i have 60000 records to change then what is the result. 
KB Tech SolutionsKB Tech Solutions
If you need to update 60000 records after the account owner changes, you should use a batch job.
NForceNForce
Hi Rajiv, 
Batch is the good solution or data load using data loader. Data loader works in batch mode.
Rajiv B 3Rajiv B 3
But I only need to change that one account owner.

No need to change or update all accounts.