An error occurred while restoring the database. User attributes cannot be modified.

Source: Internet
Author: User
After a locally debugged database is restored to the server, it finds that the user name of the database has followed the database. (This is a record in the database system table. Can this happen ?), However, if the login name is not used, you just want to create a login name for the user. However, when creating the login name, you may find it out of security considerations, the created login name cannot be used to operate the database. indicates that "user, group, or role 'xxx' already exists in the current database

If you want to manually associate the login name with the username in the database, the system will not let it; if you want to delete the user in the database, you will not be allowed to delete it again ......

In the end, we found that this situation is called "an isolated user". In fact, we can use the system's storage process sp_change_users_login:

The following parameters are explained:

ABC, not to mention, the database that you want to operate on.

Update_one, indicating that only one user is operated

Xxx and XXX are the login names of SQL Server and the usernames in the database respectively.

For more detailed usage of sp_change_users_login, refer to SQL Server online help.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.