Grant to view Database for a login User


Created two new users (userA, userB)

And have removed to view all databases for above users using DENY VIEW ALL DATABASES.

Now required to provide only one database access to above two users..
Tried using Alter Authorization command - but it provides access any ne user.
Can any ne help with providing one DB access to above wo users.

sounds like homework to me, plus please don't post things multiple times. Have you tried adding the user to the db_datareader role for a particular database?

1 Like

Without denying user to view database.
If adding to "db_datareader" then all databases will be viewed.
Post denying database if role is added then those DB is not viewed.

Tried all.

better to create a security role on server level or database level and customize that role and then add users to it.