Saturday, January 29, 2011

How can I prohibit a user (of a specific db) to see other database names in SQL Server 2008 Management Studio?

I hope the user can only see his own database name when connecting the database using SQL Server Management Studio, is it possible?

  • I don't think it's possible - but why does it matter? Don't give their login any rights to anything besides their own database and they can't make queries or do anything else where they shouldn't.

    /Edit - I knew that my knowledge is only good up through SQL 2005 - as LukeR says below, this is now possible with SQL 2008, so there you go.

    Farseeker : It can matter if the database names are, say, the names of your other clients and your other clients wish to have their identities kept private. That said, if that's the case then you should have been aware of that from the start when using MSSQL
    LukeR : It's also possible with 2005 http://msdn.microsoft.com/en-us/library/ms189077%28v=SQL.90%29.aspx
    From mfinni
  • You need to change the VIEW ANY DATABASE permission. By default it is granted to the public role, which is why all users can see all DBs.

    From LukeR

0 comments:

Post a Comment