How to run “sp_change_users_login” for all users in a database
How to run “sp_change_users_login” for all users in a database Chris Skorlinski Microsoft SQL Server Escalation Services Following a user database restore the database had orphaned users. We used TSQL commands below to build a list of sp_change_users_login commands in order to resynchronize database users with SQL logins. We then ran these sp_change_users_login commands to automatically fix the users.
Read more:
How to run “sp_change_users_login” for all users in a database


