Dropping user from database results in: “The database principal owns an assembly and cannot be dropped. (SQL error 15154).”
I’ve seen this error, “Principal owns a schema in the database” before, and you simply change the owner of the schema before dropping the user. But this is different,
But, in this case, you are given no indication as to which assembly the user supposedly owns.
The User Profile properties do not show this user owning any assemblies. When you step through the assemblies (Database -> Programability -> Assemblies), they do not show the owner as being this user you are trying to drop. In fact, in my case, it showed no owner at all. The user will not be found in ANY of the property pages of the assembly, leaving you to wonder “What makes it think this users owns this, or any, assembly?”
Here’s how you can most quickly find out which user/login SQL Server thinks is the owner of a schema:
Right-click on an assembly, and do “Script -> Create to New Query Window”, you will see the user is in fact referenced in the “AUTHORIZATION” clause of the assembly declaration. It just doesn’t appear in the properties pages.