August 23, 2011 at 12:40 pm
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
August 23, 2011 at 12:50 pm
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
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply