在 Microsoft Sql Server 2008R2 及更高版本上隐藏用于登录的数据库 [英] Hiding databases for a login on Microsoft Sql Server 2008R2 and above

查看:24
本文介绍了在 Microsoft Sql Server 2008R2 及更高版本上隐藏用于登录的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮助隐藏 sql server 2008R2 或更新版本上的可用数据库.

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.

这是 100% 但我的问题是我不希望登录甚至看到那些其他数据库可用.

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?

推荐答案

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

拉杰

这篇关于在 Microsoft Sql Server 2008R2 及更高版本上隐藏用于登录的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆