将数据库列表限制为具有SQL Server权限的数据库列表 [英] Limit Database List to Ones With Permission SQL Server

查看:88
本文介绍了将数据库列表限制为具有SQL Server权限的数据库列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,如果您通过有权访问10个数据库中的1个的帐户连接到远程SQL Server。您仍然会在对象资源管理器中看到所有其他数据库,显然由于权限的关系,您实际上无法查询它们,但是您可以看到它们的名称。

By default if you connect to a remote SQL Server via an account that has access to say 1 of the 10 databases. You will still see in the Object Explorer all other databases, obviously due to permissions you cannot actually query them, but you can see their names.

我听说有一种禁用此行为的方法,但我一直找不到答案,有人知道如何执行此操作吗?举个例子,我有一个名为MyDbServer的SQL Server,它有4个数据库,

I have heard that there is a method that disable this behavior, but I've been unable to find the answer, does anyone know how to do this? To give an example I have a SQL Server called MyDbServer, it has 4 databases,


  1. MyDatabase

  2. YourDatabse

  3. PrivateDatabase

  4. ReallyPrivateDb

  1. MyDatabase
  2. YourDatabse
  3. PrivateDatabase
  4. ReallyPrivateDb

如果通过只具有 YourDatabse权限的帐户进行连接,您仍然会看到所有其他数据库的列表,尝试查询将授予选择权限被拒绝或出现类似错误。

If you connect via an account that only has permissions to "YourDatabse" you will still see a listing of all other databases, attempts to query will grant "select" permission denied or a similar error.

出于安全考虑,我们不希望用户看到除映射到的数据库以外的任何其他数据库。

For security resons, we DO NOT want users to see any database other than the ones they are mapped to.

推荐答案

此博客讨论了隐藏数据库的方法SQL 2000和SQL 2005。

This blog talks about methods for hiding DBs for both SQL 2000 and SQL 2005.

这篇关于将数据库列表限制为具有SQL Server权限的数据库列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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