After migrating a database to another server use the system-procedure ‘sp_help_revlogin’ (on the source) to create scripts of all logins. Including PASSWORDS of all sql-logins (then run it on the target) …
exec sp_help_revlogin --all exec sp_help_revlogin 'somelogin' -- just for 'somelogin'