Can I hide undesirable database in SSMS?

admin, 13 November 2008,
Categories: Databases
1 Star2 Stars3 Stars4 Stars5 Stars
(No Ratings Yet)
Loading ... Loading ...

We have discussed the issue many times and there is an opened connection to Microsoft to add this feature in the next release. Recently I was visiting our client and we tried to do something for the subject.

1) CREATE new SQL login ‘John’
2) CREATE a user named ‘John in master database
3) GRANT CREATE DATABASE to John
4) While impersonating John, create a database called ‘demo’
5) REVOKE CREATE DATABASE permission from John
6) REVOKE VIEW ANY DATABASE permission from PUBLIC
7) Register this server as John
8) From the ‘John’ session, expand database tree. Now, you should see only master, tempdb, dbtest
9) GRANT VIEW ANY DATABASE to PUBLIC
10) From the ‘John’ session, you should see all the databases.

However, this works perfectly if the user is the owner of the database.

Comments

Leave a Reply:

Name *

Mail (hidden) *

Website

 

Related posts:

  1. Change collation in tempdb What’s happening if you installed SQL Server instance with a...
  2. SQL Server Agent Jobs duration Report Hi folks. I would like to share with you the...
  3. Quick look at IN predicate There are lots of articles and techniques onnthe internet about...
  4. Getting next value Hi folks. I’d like to share with you some technique...
  5. Getting row count of table in SQL Server 2005 It is much easier in SQL Server 2005 to get...