In order to reset the user permissions, you can use the system command sp_change_users_login.
When passing REPORT as a parameter, it will list all the orphan users.
sp_change_users_login REPORT
GO
You can then re-assign the orphan users to existing users by using the following command:
sp_change_users_login UPDATE_ONE, 'ORPHAN_USER', 'LOGIN'
Example:
sp_change_users_login UPDATE_ONE, 'production_account', 'qa_account'
GO
1 comment:
Thank you so much, you saved me a bunch of work having to manually reassign table/sproc permissions!
Post a Comment