2

I have got myself into a little bit of a bind, using SQL Server Management Studio to create a database in Azure SQL. My issue appears to be with assigning roles to users in the database. When I created the database, it prompted me to create a new login, with an associated user, that appeared to have all the rights of a database owner. However, I am now trying to create two additional logins and I realize I am screwed. The login that I created when I made the database isn't the database owner, even though I could do all the DDL / DML necessary to create the full schema under that account. I created an additional login, and I added two users to that login. I now want to add that login to a role (db_datareader, db_denywrite) but I cannot. It appears that the database owner is a user / login called "dbo" that I did not set up. This is the only user that is added as a database owner, and subsequently is the only one that can edit roles. But I do not know the login credentials for this user! if I use what I believed to be the administrator account (the one I made) to add a role I get the error:

Cannot alter the role 'db_datareader', because it does not exist or you do not have permission.

How can I fix this? How can I get my original account added as a DB Owner? There has got to be a way, but everything I tried points to the fact that I am not the owner of the resource I created; I'm an outcast in my own country...

Thanks!

  • could you try resetting the password from [this](https://stackoverflow.com/a/39215409/7073340) – Jayendran Nov 27 '18 at 16:23
  • I have a similar issue at the moment. I'm using an Elastic Pool, and my user has the rights to make people db_datareader (or any other role) in any database other than master, but in master I get exactly the same problem as you. – Matt Shepherd Apr 12 '19 at 00:49

0 Answers0