System.LimitException: Too many DML rows: 10001

System.LimitException: Too many DML rows: 10001 error occurs, when we try to do DML operations to more than 10000 records at a time.

If we want to do DML operations to more than 10000 records at a time, we have to call a batch class from the current class to handle it separately.

Cheers!!!