Error: 15138 failed to delete the database because the database owner has a schema in the database and cannot delete the database. Solution)

Source: Internet
Author: User

Microsoft SQL Server Error: 15138 failed to delete the database because the database owner has a schema in the database and cannot delete the database. Solution
An error occurred while deleting the *** user. (Microsoft. SqlServer. Smo)

Click: http://go.microsoft.com/fwlink? For help information? ProdName = Microsoft + SQL + Server & ProdVer =

9.00.1523.00 & EvtSrc = Microsoft. SqlServer. Management. Smo.

ExceptionTemplates. FailedOperationExceptionText & EvtID = Delete + User & LinkId = 20476

------------------------------
Other information:

An exception occurred when executing a Transact-SQL statement or batch processing. (Microsoft. SqlServer. ConnectionInfo)

------------------------------

The database entity has a schema in the database and cannot be deleted. (Microsoft SQL Server, error: 15138)

Click: http://go.microsoft.com/fwlink? For help information? ProdName = Microsoft + SQL + Server & ProdVer = 09.00.1399 & EvtSrc = MSSQLServer & EvtID = 15138 & LinkId = 20476

Solution 1

Delete the schema of the user, and then delete the corresponding user
Procedure
1. SQL SERVER MANAGEMENT STUDIO -- database -- Security -- Architecture, first Delete the corresponding Architecture
2. SQL SERVER MANAGEMENT STUDIO -- database -- Security -- user, delete corresponding user

Solution 2

-- Execute the following SQL statement

Alter authorization on schema: db_owner TO dbo;
-- Then manually delete it.

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.