How to run “sp_change_users_login” for all users in a database
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. In SQL 2005 and SQL 2008 the SQL login is created and automatically
Read More »