Find out multiple db_owners

  • Hi,

    I'm using the below command to find out the owner of the database

    select suser_sname(sid) from sys.sysdatabases where name = 'Mydb'

    I'm getting the Onwer of the database.

    But I also created a login ABC\Admin and mapped that user to Mydb granting db_owner database role

    But it's NOT showing up in the results when I execute above command? Please advice

  • Adding a login to the db_owner role does not make it the owner of the database. A database has a single owner, shown by the query you ran. There can be multiple logins that are members of the db_owner role. It's just a database security role.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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