The database principal owns a schema in the database, and cannot be dropped message
The T-SQL way works. Thanks to http://zarez.net/?p=179 I found the SSMS way to do this (UI).
To change the schema owner from Sql Server Management Studio:
Expand your database -> Security -> Schemas
In the Object Explorer Details you can see a list of the schemas and the owners:
If you don't know what schema(s) the User owns, check the properties of the User.
Open up the properties of the schema that the User owns, and click "Search" to find a new owner. If you don't know the new owner, you can "Browse" for one.
Properites -> Search -> Browse
and you can change the schema owner to dbo (or whoever is most appropriate).
Try the T-SQL to do this:
alter authorization
on schema::YourSchemaName
to dbo
go
drop user TheUserYouWantToDelete
go
You can't drop a principal that is a schema owner, so the ALTER AUTHORZATION
changes the owned schema (I used YourSchemaName
, but obviously substitute that with the owned schema in your database) to dbo
(likewise, you can change ownership to whatever principal you need in your environment). That will allow you to drop the previously-schema-owning user (for example purposes I used TheUserYouWantToDelete
, but that'll be the now non-owner that you want to drop).