Is there a way to stop MS SQL Server listing databases for a user which does not have access to those databases? At the开发者_JS百科 moment if I setup a user on database A I can still see database B, C, D, E and so on, although I do not have permissions access them.
All SQL logins are members of the 'public' server-level role, which by default has the VIEW ANY DATABASE permission. This will revoke that permission :
REVOKE VIEW ANY DATABASE FROM public
精彩评论