当基表位于不同的数据库中时,在视图而非基表上授予选择 [英] Grant Select on a view not base table when base table is in a different database

查看:10
本文介绍了当基表位于不同的数据库中时,在视图而非基表上授予选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个视图,它从不同数据库的表中选择行.我想授予对视图的选择访问权限,但不授予对基表的直接访问权限.该视图有一个限制行数的 where 子句.

I have a view which is selecting rows from a table in a different database. I'd like to grant select access to the view, but not direct access to the base table. The view has a where clause restricting the number of rows.

我可以将选择授予视图而不是基表,还是需要切换到存储过程?我宁愿不这样做.

Can I grant select to the view and not the base table, or do I need to switch to a stored procedure? I would rather not do it the latter way.

推荐答案

当您在评论中指出相关表位于不同的数据库中时,所有权链适用.我怀疑某处的链条中断了 - 检查该链接以获取完整详细信息.

As you state in one of your comments that the table in question is in a different database, then ownership chaining applies. I suspect there is a break in the chain somewhere - check that link for full details.

这篇关于当基表位于不同的数据库中时,在视图而非基表上授予选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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