A user with db_datareader role has SELECT access to all table. How do I exclude one table?

孤街浪徒 提交于 2019-12-25 14:08:37

问题


I have SQL2008R02 database user added to the data reader role. This user can SELECT all tables. But I want to him to restrict him from one table. How do I do this? I do not want to run GRANT SELECT individually on all tables except one.


回答1:


You can use a DENY permission on the one table, for example:

DENY SELECT ON myTable TO myUser

DENY "permissions" are available in SQL 2008 onwards.

https://msdn.microsoft.com/en-GB/library/ms188338.aspx



来源:https://stackoverflow.com/questions/26978536/a-user-with-db-datareader-role-has-select-access-to-all-table-how-do-i-exclude

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!