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


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.


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.

  • 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 Sep 15 '10 at 2:14
  • It's also possible with 2005 msdn.microsoft.com/en-us/library/ms189077%28v=SQL.90%29.aspx
    – LukeR
    Sep 15 '10 at 3:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.