Add to collection
Expert User

Expert User

Verified

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

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 0

  • Sorry!! No comment posted yet. Become the first user to give comment.
Add a comment

Would you like to write for w3 sniff?

Become part of an amazing group of contributors and authors and start writing for us

Join Now
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;
Feedback submitted successfully.