Add to collection
Expert User

Expert User

Verified

The database principal owns a message type 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

To find the owners of service types, run the following T-SQL:

select dp.name, smt.*
from sys.service_message_types smt
inner join sys.database_principals dp on smt.principal_id = dp.principal_id

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

select dp.name, smt.*
from sys.service_message_types smt
inner join sys.database_principals dp on smt.principal_id = dp.principal_id


ALTER AUTHORIZATION ON MESSAGE TYPE::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, smt.*
from sys.service_message_types smt
inner join sys.database_principals dp on smt.principal_id = dp.principal_id


ALTER AUTHORIZATION ON MESSAGE TYPE::Name TO dbo;
Feedback submitted successfully.