sql server error "The database principal owns a schema in the database, and cannot be dropped."

In SQL Server 2005, if you try to drop a database user by right-clicking the user name and clicking Delete, you may encounter an error as follows.
"The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error: 15138).

This problem normally occurs when a user owns a schema and you are trying to delete the user.
There are many workarounds for these one is

 Using the GUI in "Object Explorer" (MS SQL Management Studio) Expand the [databasename] / Security.
Click on Schemas. 
In summary window, determine which Schema(s) are owned by the user and either change the owner or remove the Scheme(s). 
The user can then be deleted.

Or using AdventureWorks DB you can for example:-

USE AdventureWorks;
GO
ALTER SCHEMA HumanResources TRANSFER Person.Address;
Go




And HAPPY GO LUCKY

posted @ Wednesday, August 01, 2007 11:44 PM

Print

Comments on this entry:

# re: sql server error "The database principal owns a schema in the database, and cannot be dropped."

Left by Enrique Pasos at 9/17/2007 10:34 AM
Gravatar
Worked for me! Thx.

# re: sql server error "The database principal owns a schema in the database, and cannot be dropped."

Left by imran at 12/6/2007 3:20 AM
Gravatar
this really works. :D

# re: sql server error "The database principal owns a schema in the database, and cannot be dropped."

Left by Fred at 1/21/2008 1:58 AM
Gravatar
Thank you so much !

# re: sql server error "The database principal owns a schema in the database, and cannot be dropped."

Left by Harun at 8/12/2008 2:47 AM
Gravatar
Thank you it works...

# re: sql server error "The database principal owns a schema in the database, and cannot be dropped."

Left by MaryCR at 10/15/2008 7:40 AM
Gravatar
Excellent!!! It works for me too :)

# re: sql server error "The database principal owns a schema in the database, and cannot be dropped."

Left by Ruslan at 11/4/2008 5:39 AM
Gravatar
Thanks very much!

# re: sql server error "The database principal owns a schema in the database, and cannot be dropped."

Left by Joris at 2/18/2009 12:33 AM
Gravatar
Finally a good solution! You're my hero! :)

# re: sql server error "The database principal owns a schema in the database, and cannot be dropped."

Left by cbrad at 5/8/2009 9:14 PM
Gravatar
thank you

# re: sql server error "The database principal owns a schema in the database, and cannot be dropped."

Left by Sonic7771 at 5/23/2009 12:02 AM
Gravatar
Nice and simple.....thks.

# re: sql server error "The database principal owns a schema in the database, and cannot be dropped."

Left by Simm at 6/17/2009 8:53 PM
Gravatar
plain and simple that works !!!

# re: sql server error "The database principal owns a schema in the database, and cannot be dropped."

Left by Vythees at 7/3/2009 12:00 PM
Gravatar
Thats very great tip. Grazie.

# re: sql server error "The database principal owns a schema in the database, and cannot be dropped."

Left by kapil sharma at 8/24/2009 3:37 AM
Gravatar
thank u very much
its working fine

# re: sql server error "The database principal owns a schema in the database, and cannot be dropped."

Left by hardy at 11/6/2009 11:41 PM
Gravatar
Thnax !

# re: sql server error "The database principal owns a schema in the database, and cannot be dropped."

Left by Dragos at 11/13/2009 2:02 PM
Gravatar
Worked for me ! Thanks alot !!

Your comment:



 (will not be displayed)


 
 
 
 

Live Comment Preview:

 
«November»
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345