Fix SQL server login issues for restored database

When we restore the database in SQL server, sometimes we may face problem in login with the existing login credentials in restored database. to fix the issue just run the below query by replacing the 'uname' with your login username.

Below SQL query will fixes the login problem for user 'uname' .

EXEC sp_change_users_login 'Auto_Fix', 'uname'