The database principal owns a message type 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, 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;
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;
Comments
Leave a Comment