The SQL Server prompts "the selected user has an object, so this user cannot be removed"

Source: Internet
Author: User

I tried some methods provided on the Internet and finally solved some problems with SQL.
1. Select the database in the query analyzer and enter:
Exec sp_configure 'Allow updates', 1 -- allow updating system tables.
Reconfigure with override
2. Run the following SQL statement:
Update sysobjects set UID = 1 -- all objects in the database belong to the user DBO
3. Execute the following SQL statement:
Exec sp_configure 'Allow updates', 0 -- disable system table update
Reconfigure with override
4. Delete the users in the database and recreate the user.
The reasons for this problem are as follows:
Problems that are easily encountered when MSSQL backup is transplanted to another server for restoration ......
Problems that may occur when MSSQL backup is transplanted to another server for restoration, especially when the database backed up from the VM is restored locally...
The original user name and password of the SQL statement are invalid.
A system table cannot be deleted.
When the SELECT statement is connected using SA, the system prompts that the table name is invalid.
The user name in the original backup database cannot be deleted, and the prompt "the user cannot be deleted because the selected user has an object ."
The main reason is that the original user information is retained during Backup recovery, resulting in isolated users ......

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.