As @WilliamD says, this has been addressed before. Summary: `sp_change_users_login` is your friend. Documentation:
http://msdn.microsoft.com/en-gb/library/ms174378.aspx Usage: `sp_change_users_login 'Report'` within a DB to get a list of orphaned users Usage 2: `sp_change_users_login 'Auto_Fix', ''` to associate a database user with a DB server level user that already exists. More than that - read the documentation - it can get a bit fiddly and a bit dangerous.