I have an SQL Server with several users and databases. The permissions are imho simple:

  • user1 is db_owner of user1_db1
  • user2 is db_owner of user2_db1
  • user3 is db_owner of user3_db1
  • user3 is db_owner of user3_db2

If a user logs in to the server with Management Studio, he sees all databases. He has no rights on it (obviously OK). But he sees them. Which is not optimal.

How can I setup the SQL Server, that when a user logs in, he only gets the databases in which he is db_owner?


See Hide SQL database from Management Studio on stackoverflow (why it's there is beyond me but the taxonomy here is bizzare to say the least)

| improve this answer | |
  • That doesn't work. If I revoke the VIEW ANY DATABASE rights from role "public", it hides all databases from all users. I think that is because all users are in the "public" server role. – Remy Nov 16 '10 at 15:45
  • yes users can only see databases they are the owner of. I tried the instructions in this answer ande they seemed to work for me: stackoverflow.com/questions/935018/… – Jim B Nov 18 '10 at 13:01

You can Deny access to see them for your instance via Server Properties/ Permissions/ and set deny for login for View Any Database right.

Hope this helps :)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.