Recover the login name after database restoration
2008-09-30
When you restore a database from backup using SQL Server Enterprise Manager (or Management Studio), sometimes you may find the login name for this database is missing while the user name exists.
For that case, check Security node to see if the username exists or not. Create the corresponding username and assign the password if it is missing.
And then go to the Query Analyzer and connect to that database with sa account or your local window network ID, and execute the following command then it should work.
| sp_change_users_login 'update_one', '[user]','[login]' |
Replace the [user] and [login] tags with your own. (most probably they are the same)
Previous Article:
How to retrieve records in random order?