Sql Server Fix Logins

Sometimes when copying databases, for instance from production down to development, the user accounts become dysfunctional. The database login no longer matches the overall server login. To re-synchronize them use:

exec sp_change_users_login auto_fix, ‘someusername’