Hiding databases for a login on Microsoft Sql Serv

2019-03-13 10:43发布

Please can anyone assist with hiding the available databases on sql server 2008R2 or newer versions.

I have a new login user that I mapped to a specific database. When logging in with the specific login user I can see all the databases on the server, although I cannot access them except for the one I mapped to the login.

This is 100% but my problem is that I do not want the login to even see that those other databases are available.

How do I prevent those other databases that are not mapped to the login from displaying?

1条回答
We Are One
2楼-- · 2019-03-13 11:16
USE master;
GO
DENY VIEW ANY DATABASE TO [newlogin]; 
GO
USE yourDB;
GO
DROP USER newlogin;
GO
USE master;
GO
ALTER AUTHORIZATION ON DATABASE::yourDB TO [newlogin];
GO

Raj

查看更多
登录 后发表回答