The database principal has a schema in the database and cannot delete the workaround

Source: Internet
Author: User
A dedicated administrator is established on the server database because the test wants to delete it, but always prompts the user to have the schema cannot be deleted, and the schema display db_owner can not be changed, I use the sqlserver2008. Deleting a database user in SQL Server2000 is simple, as long as you delete it directly or use the drop User command, but it is not possible to do it directly in SQL Server2008 because the schema is treated as an entity in SQL Server 2008. So to remove the user, you need to first remove the schema owned by that user or change the owner of the schema. Otherwise, you will be prompted that the database principal has a schema in the database and cannot be deleted.

Searched for a bit. Know that each database user corresponds to a system login account, and each schema can only be given to one user. Therefore, it is not possible to delete the user's schema directly, and then I will create a new login name, and in the user mapping the db_owner architecture will be paid to him, and then you can delete the previous 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.