In SQL2000, this user cannot be removed because the selected user has an object.

Source: Internet
Author: User

From: http://hi.baidu.com/momodetang/blog/item/8ffe01fdb3a7eb4fd6887dbb.html

 

 

Due to mssql2000 database errors, I restored an original database to the current SQL statement. Now I came to the user and wanted to delete the restored user, the result shows that "the selected user cannot remove this user because the user has an object ":


If the user cannot be deleted, I am going to add the user in the system to this database to see if it is OK, but the following error is prompted (Microsoft SQL-DMO window ):

Error 21002: [SQL-DMO] user "liuhui" already exists.

Because of business requirements, I cannot create a new user for it or for another user. This database can only be used by this user, and the standard and Standard Server Format cannot be broken, it will not bring about the super trouble of future maintenance, and there is no way to ask for help from Google and Baidu. The result is unknown, and they let me down. There is no way, so I have to ask for help from an experienced friend and solve the problem, this technology is not a secret, and I will not tell the average person:
1. Open the Enterprise Manager, expand the server, right-click the local server,Attribute:

Open the SQL Server properties (configuration) window
2. SelectGeneralWindow, SetEnable SQL Server proxy automaticallySelected


OK

3. Repeat Action 1. Open and openSQL Server properties (configuration) window, Select the server settings window:

SetAllows direct modification of System DirectoriesSelect, OK.

4. Expand the database, view the database system table sysusers, right-click --Open Table--Returns all rows.:

5. Select the user to be added for restoration, find the relevant row, right-clickDelete:

SelectYes

Go back to the user list and check whether there is any user. If there is no user, add the user corresponding to the database in SQL security. I added liuhui, the test is okay.

Return Action 3.Allows direct modification of System DirectoriesRemove

You can also delete this user by using the following method, and change all the owner objects in the data table to DBO. It is no longer a problem to delete the user.

 

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.