This is more of a note for my server administrators. Every time they restore databases for past projects they recieve error on unable to connect to login id associated with database. Now when they click on users in database they can see them but cant access them.
The problem is associated with orphan users hence simple problem calls for simple solution
Step 1 : Login using Super Admin into Query Analyzer
Step 2: select database which has been restored
Step 3: Run following command “sp_revokedbaccess ‘username’ ”
Step 4: Run following command “sp_droplogin <username> ”
Boom the user will be deleted and then you can create a new account and link it back to database.