Security assignments in DB

I need some help with our database. The CRM was migrated before I was apart of the company and when it was none of the security groups were migrated correctly. We have sale reps that can see everything in the system when they should only be assigned to their region. I have looked at the DB and have not found a way to run scripted that will assign the correct security group id to the correct account. I need to be able to do this for emails and contacts as well. Any help is much appreciated. I am even looking for a consultant that is will to fix this at a cost.