SQL Server: Script to Hide all Databases in SSMS

In this post, I provide one script to hide all databases for all public login in SQL Server Management Studio.
Generally, we are hiding all databases for security reason.
Using this script you can hide all databases for all user logins.

Once you execute this script, you will not be able to see any databases in SQL Server Management Studio. Only the sysadmin login or owner of the database can see the databases in SQL Server Management Studio.

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from dbrnd.com

Leave a Reply

3 Comments on "SQL Server: Script to Hide all Databases in SSMS"

Notify of
Sort by:   newest | oldest | most voted

This is a great tip particularly to thopse fresh to
the blogosphere. Simple but very precise info…
Thank you for sharing this one. A must read article!


Thanks on your marvelous posting! I genuinely enjoyed reading it, you are a great
author. I will be sure to bookmark your blog and definitely will come back someday.
I want to encourage you to continue your great writing, have a nice


hi!,I like your writing so so much! proportion we keep in touch extra approximately your article on AOL? I need an expert on this space to resolve my problem. Maybe that’s you! Looking ahead to look you.