(Note this question asks about linking ALL Users, unlike the possible duplicate that asks about linking a single user)
I wish to move a database between two servers, I
If:
EXEC sp_change_users_login 'Auto_Fix' , 'TheUserName';
Doest't work, try this:
EXEC sp_change_users_login 'Auto_Fix', 'Username', NULL, 'p@ssword123'
I found it here: http://dbadiaries.com/using-sp_change_users_login-to-fix-sql-server-orphaned-users