So during my ongoing mission to protect as well as assassinate all database servers I am responsible for (I will explain how you protect and assassinate at the same time, but later) I ran into the following error when I was attempting to access the properties of some databases through SSMS.
Property Owner is not available for Database ‘[DATABASENAME]’. This property may not exist for this object, or may not be retrievable due to insufficient access rights. (Microsoft.SqlServer.Smo)
My first reaction, naturally, was to say “damn.” After that a quick Google search informed me that this occurs when the original db owner is dropped from the security list (I have a post about orphaned users, or at least I will as soon as I finish this one up).
First run sp_helpdb DATABASENAME and notice the column in the first query table,
owner will = ~~UNKNOWN~~
I would like to point out how I kind of like that they used the squiggly lines ~~~ often used in crude ascii art to denote the money shot, or head shot.
What do you do, the answer is pretty simple, you run: EXEC sp_changedbowner ‘NewOwner’