The database principal owns a schema in the database, and cannot be dropped. – Fix
-
Posted on June 17, 2009 by Derek Dieter
-
6
If you try to drop a user that owns a schema, you will receive the following error message:
[code]
The database principal owns a schema in the database, and cannot be dropped.
[/code]
In order to drop the user, you need to find the schemas they are assigned, then transfer the ownership to another user or role
[cc lang=”sql”]
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
[/cc]
- Comments (RSS)
- Trackback
- Permalink
thank you
Thank you, I’ve recently been serichang for information about this subject for a long time and yours is the best I have came upon till now. But, what in regards to the bottom line? Are you positive concerning the source?|What i don’t realize is actually how you are now not really a lot more smartly-favored than you may be right now. You are so intelligent.
Thanks for the helpful info, Derek. May I ask why you would alias the table name in this case?