By now, most DBA’s must be familiar with “Alter user with login” command from SQL 2005 SP2 and above. But when only SQL 2000 existed we had to do a lot more things manualy. Migrating logins/users has always been a pain, but at least MS had a few built-in procedures to make our life easier.
The equivalent of “Alter user” in 2000 is “sp_change_users_login”. Bellow you have an exemple extracted from this great post.
--Lists usernames that are not mapped to logins exec sp_change_users_login 'report' --Map db username to server login if names match exec sp_change_users_login 'update_one', 'username' --Maps db username to server login if names match, --If no login exists, it creates one with the password given. exec sp_change_users_login 'auto_fix', 'username' , 'password'