SQL Server/T-SQL Tutorial/System Functions/sp change users login
Fixing Orphaned Database Users
SELECT s.name LoginName, d.name DbName, d.sid
FROM sys.database_principals d
INNER JOIN sys.server_principals s ON
d.sid = s.sid
WHERE s.name = "YourName"
EXEC sp_change_users_login "Report"
EXEC sp_change_users_login "Auto_Fix", "Danny", NULL, "newDannypassword!#@"