Question: I moved a database from SQL Server 2012 to Azure. I don't want to use the user `master`, so I created a user `test`. This is what I did for database XXX on Azure:

```
create user test from login test with default_schema=[dbo]
exec sp_addrolemember 'db_owner','test'

```

I checked, and the database objects I am interested in are all in the schema `dbo`. The table `Users` is in the schema `dbo`.

The connection string in my web project has `test` as the login. It produces the error message:

```
The SELECT permission was denied on the object 'Users', database 'XXX', schema 'dbo'

```

What does the error message mean and what can I do to let user `test` access the database XXX?

Answer: 
1. Open SQL Management Studio
2. Expand your database
3. Expand the "Security" Folder
4. Expand "Users"
5. Right click the user (the one that's trying to perform the query) and select `Properties`.
6. Select page `Membership`.
7. Make sure you uncheck 

`db_denydatareader`

`db_denydatawriter`

[![enter image description here](https://i.stack.imgur.com/zvmJl.png)](https://i.stack.imgur.com/zvmJl.png)

This should go without saying, but only grant the permissions to what the user needs. An easy lazy fix is to check `db_owner` like I have, but this is not the best security practice.
This is how I was able to solve the problem when I faced it 

1. Start SQL Management Studio.
2. Expand the Server Node (in the 'Object Explorer').
3. Expand the Databases Node and then expand the specific Database which you are trying to access using the specific user.
4. Expand the Users node under the Security node for the database.
5. Right click the specific user and click 'properties'. You will get a dialog box.
6. Make sure the user is a member of the db\_owner group (please read the comments below before you use go this path) and other required changes using the view. (I used this for 2016. Not sure how the specific dialog look like in other version and hence not being specific)