The database principal owns a schema in the database, and cannot be dropped.
The problem is as the error message states the User you are trying to delete is an owner of at least one Schema in your SQL Server. Thus it cannot dropped unless the DB Schema owners are changed explicitly.
So since you are using SSMS (SQL Server Management Studio) to drop the User here are the steps you should follow to get that done correctly:
Here is the User we are going to Drop (Delete) in this example (named CC_User):
Under Schemas you will find all your Schema’s that belong to the Database in question:
The window above, shows the “Schema Owner” change that to another owner, if you don’t know which set it to default owner which is named the same as the schema itself for all schemas (by default).
e.g. db_datareader default schema owner is “db_datareader”.
Remember to go through all Schemas in your DB and check if the user owns any of them, if it does replace it with another owner. The User Drop wont work unless the user ownership is removed on all schemas.
Your answer is good, but not good enough for my case, it really does the Job when using SQL Server Management Studio itself,
But unfortunately I also need to remove Users programmatically from the back-end if possible.