There is also a built-in stored procedure called 'sp_change_users_login'. It works on the current database and only for sql accounts, not windows logins. It can be used to list orphaned users and to reconnect them. I am not sure if it is available before SQL 2005.