"Try to learn something about everything and everything about something." -Thomas H. Huxley

I recently had some issues with site owners on my SharePoint sites. Specifically, one of the sites didn't have one altogether. The frontend and command line tools all reported "User could not be found". This also derived from the error "You cannot delete the owners of a Web site collection" when attempting to remove a user for a dead account.

If you find yourself in that predicament, the following SQL query can be run on any of the content databases to determine who (if anyone) is currently the owner or secondary owner of each site: