If you try to drop a user that owns a schema, you will receive the following error message:
The database principal owns a schema in the database, and cannot be dropped.
In order to drop the user, you need to find the schemas they are assigned, then transfer the ownership to another user or role
SELECT s.name
FROM sys.schemas s
WHERE s.principal_id = USER_ID('joe')
-- now use the names you find from the above query below in place of the SchemaName below
ALTER AUTHORIZATION ON SCHEMA::SchemaName TO dbo
Popular search terms:
- The database principal owns a schema in the database and cannot be dropped
- the database principal owns a schema in the database and cannot be dropped sql server 2008
- The database principal owns a database role and cannot be dropped
- database principal owns a schema in the database and cannot be dropped
- the database principal owns a schema in the database and cannot be dropped sql server 2005
Thanks a lot..This article helped us
thanks..
Thanks. This helped alot.
Thank you for this post, very much appreciated!
Thanks a lot!
Excellent, saved me lot of time…
Hi
Thanks,
The time this saves can be measured in days, not hours!
Brilliant! Thanks!
Thanks, quick fix.
Thanks for the helpful info, Derek. May I ask why you would alias the table name in this case?
Great! Thanks..
great!solve my problem
Cool, thanks
Excellent!! Thank you
I did attach database from my backup then I got the old database user come togeter. I used this note then can drop the old user.
cheer!!!
Thanks
Cool. In using the schemas, I’ve had to use this a lot myself. I finally memorized it. (after looking it up hundreds of times)..