manas
manas

Reputation: 6400

How to show filter databases in management studio object explorer

My database is hosted in a shared hosting. I connect my database remotely in Management Studio Express. Whenever i try to connect to sqlserver instance it shows all the databases that are hosted in that server instance. This annoying to find out your database out of 400 database of the other users all the time.

Is there a any way to filter down the list of databases to those i won or have permission ? i don't want to see databases that i don't have permission or i don't own.

Remember my database is hosted in a shared hosting and as a user i have limited privilege.

Upvotes: 3

Views: 1735

Answers (2)

Andrei Rantsevich
Andrei Rantsevich

Reputation: 2945

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

Upvotes: 1

DCaugs
DCaugs

Reputation: 494

I've researched a similar issue and the only method I've found that works for this is a little hackish, however it may work for you in this case. If you (or the administrator of your shared host) is able to make your login the DBO of your database, and then also DENY VIEW to all databases for your login, you should only see the database that your login owns when you connect. So the t-sql would be:

`USE AdventureWorks2008R2

ALTER AUTHORIZATION ON DATABASE::AdventureWorks2008R2 to TestLogin

USE MASTER

DENY VIEW ANY DATABASE TO TestLogin`

Not sure if this is a fit for your scenario, and definitely not saying it is a best practice, but maybe it helps!

Upvotes: 1

Related Questions