List of all OWNERS, not db_owner

  • How can I get a list of all database owners in an instance (not db_owners but actual owners) for each and every databases in an instance? I know I can query one database at a time, but I would like one query that will get them all.

    Thanks,

    Tom

  • SELECT name, SUSER_SNAME(owner_sid)
    FROM [sys].databases

    That query should do it.   Is that what you were looking for?

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply