How to show filter databases in the explorer object of a control object

My database is hosted on shared hosting. I am deleting a remote database in Management Studio Express. Whenever I try to connect to an instance of sqlserver, it shows all the databases hosted on that server instance. It's annoying to find out your database of 400 other users' databases all the time.

Is there a way to filter the list of databases for those who won or received permission? I don't want to see databases that I don't have permission or I don't own.

Remember, my database is hosted on shared hosting and I have limited privilege.

+3


source to share


2 answers


I researched a similar issue and the only method I found that works for this is a bit hacky, however it might work for you in this case. If you (or the administrator of your shared host) can make your DBO login of your database and then also DENY VIEW for all databases for your login, you should only see the database that your login has when connecting. So t-sql would be:

`USE AdventureWorks2008R2

ALTER AUTHORIZATION ON DATABASE :: AdventureWorks2008R2 for TestLogin



USE THE MASTER

DENY VIEW ANY DATABASE TO TestLogin`

Not sure if this works for your scenario, and definitely doesn't say it's best practice, but maybe it helps!

+1


source


I have created a solution to this problem in SSMSBoost add-on for SSMS (I am the developer of this add-on). There is a special "Smart connection switch" combo box in the toolbar that you can configure to display your preferred connections (Preferred connections), you can also display all local databases BUT only those that you have access to.



0


source







All Articles