Link to home
Start Free TrialLog in
Avatar of patd1
patd1Flag for United States of America

asked on

set the role_membership for this user after the restore

Using sql server 2012 std edition

I am restoring a database on another server as part of my sql job and then running some data processing jobs on the restored data.

The problem that I am facing is that the windows user that the data processing job runs under, loses the db_owner role_membership  after the restore so the data processing job fails while running data reads.

How can I set the role membership for this windows user using t-sql after the restore step, and before data processing. I can run this t-sql under a different sql user.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of PadawanDBA
PadawanDBA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of patd1

ASKER

Thank You. Alter role works for me.