To totally unlock this section you need to Log-in
Login
The database principal owns a schema in the database, and cannot be dropped
It could happen sometimes that you are trying to remove a user from database but every single time you're getting an error and so you are not able to remove the user.
The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error: 15138)
It could be very urgent scenario, specially if you need to re-assign the same user again to the same SQL login. The reason for error is quite clear from the error message as there were schema associated with the user and that needs to be transferred to another user.
Workaround / Resolution / Fix:
Let us assume that user was trying to delete user which is named as ‘sql_user’ and it exists in the database ‘AdventureWorks’.
Now run following script with the context of the database where user belongs.
USE AdventureWorks;
SELECT s.name
FROM sys.schemas s
WHERE s.principal_id = USER_ID('sql_user');
To totally unlock this section you need to Log-in
Login
Heelpbook.net – Error 15138: The database principal owns a schema in the database, and cannot be dropped – http://heelpbook.altervista.org/?p=36989 – HeelpBook – Visit http://www.heelpbook.net OR http://mobile.heelpbook.net on your tablet! #heelpbook #howto @heelpbook