set the role_membership for this user after the restore
Posted on 2014-02-17
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.