SQL Principal owns assembly and cannot be dropped…

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.


About combatdba

I'm a production DBA at a terabyte-class SQL Server Shop
This entry was posted in S.W.A.T.. Bookmark the permalink.

One Response to SQL Principal owns assembly and cannot be dropped…

  1. sagaya says:

    Thanks a lot

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s