The database principal owns a contract in the database, and cannot be dropped.

Expert User Verified
When dropping a user from a database, sometimes they own a table or a schema, and you can go drop them.
select dp.name, sc.*
from sys.service_contracts sc
inner join sys.database_principals dp on sc.principal_id = dp.principal_id

To change the owner to dbo, run the following:
ALTER AUTHORIZATION ON CONTRACT::Name TO dbo;

select dp.name, sc.*
from sys.service_contracts sc
inner join sys.database_principals dp on sc.principal_id = dp.principal_id

To change the owner to dbo, run the following:
ALTER AUTHORIZATION ON CONTRACT::Name TO dbo;

Comments

Leave a Comment