Grant Select on a view not base table when base table is in a different database

前端 未结 10 1899
广开言路
广开言路 2020-11-30 07:28

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

10条回答
  •  一生所求
    2020-11-30 08:21

    I also had this problem. I used information from link, mentioned above, and found quick solution. If you have different schema, lets say test, and create user utest, owner of schema test and among views in schema test you have view vTestView, based on tables from schema dbo, while selecting from it you'll get error mentioned above - no access to base objects. It was enough for me to execute statement

    ALTER AUTHORIZATION ON test.vTestView TO dbo;

    which means that I change an ownership of vTextView from schema it belongs to (test) to database user dbo, owner of schema dbo. After that without any other permissions required user utest will be able to access data from test.vTestView

提交回复
热议问题