Row-level-security on view

sakuraime 2,321 Reputation points
2022-05-15T15:04:22.693+00:00

Is it possible to apply row level security on a SQL View ? thanks

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,811 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 101.8K Reputation points MVP
    2022-05-15T18:45:22.627+00:00

    The topic Row -Level Security includes this passage:

    Indexed views: In general, security policies can be created on top of views, and views can be created on top of tables that are bound by security policies. However, indexed views cannot be created on top of tables that have a security policy, because row lookups via the index would bypass the policy.

    There is also:

    Partitioned Views: Block predicates cannot be defined on partitioned views, and partitioned views cannot be created on top of tables that use block predicates. Filter predicates are compatible with partitioned views.

    Which is sort of interesting, since a partitioned view is simply a view that fulfils certain condition.

    0 comments No comments