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

前端 未结 10 1894
广开言路
广开言路 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条回答
  •  -上瘾入骨i
    2020-11-30 08:17

    Create view Schema1.viewName1 as (select * from plaplapla)

    Schema1 has all the tables

    Create view Schema2.viewName2 as (select * from schema1.viewName1)

    schema2 has no tables(only views schema)

    In this case you can execute (select * from viewName2) in schema2 , BUT .. If you deleted viewNmae1 from Schema1 , Then ViewName2 will not work..

    Amani El Gamal aljamalaisj81@gmail.com

提交回复
热议问题