Dropping a user which owns a schema will result in the error message “The database principal owns a schema in the database, and cannot be dropped”.
To solve this you can assign the schema back to its base principal with the ALTER AUTHORIZATION message, or it can be moved to another user/principal.
If for example user Test1 owns the db_owner schema and you want to drop Test1 but don’t have another user to move the schema to you can type:
ALTER AUTHORIZATION ON SCHEMA::db_owner TO db_owner
(or for example db_datawriter if that was the case and so on)
If you wanted to move the schema to another user the syntax would be:
ALTER AUTHORIZATION ON SCHEMA::<theSchema> TO userName
Thanks very much for this helpful bit of information.
Awesome, thanks!
Thanks for the great post.
nice suggestion
Thank you very much!!!
Thanks! My problem is solved!I searched for hours and could not find this solution.
Great, just what I needed.
Thanks for sharing
Perfect. Thanks man!
Very usefull solution… thanks
Thanks, just what I needed
Thank a lot , you just saved me…Great Job
10 puntos master