2017-02-03 13 views
0

データベースにセキュリティポリシーを作成しました。ビューにインデックスを作成しようとしているときに、Microsoft SQL Server、エラー:33266

The index on the view 'dbo.vwUserFullNames' cannot be created because the view is referencing table 'dbo.Persons' that is referenced by a security policy.

セキュリティポリシーでビューにインデックスを作成することは可能ですか?

いいえ、それはありません

CREATE VIEW [dbo].[vwUserFullNames] WITH SCHEMABINDING AS //select ... 

答えて

0

ビューを作成します。 documentationパー:

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.

可能な回避策は、ビュー上のセキュリティポリシーを定義することですが、その後、あなたのテーブルには、いずれかを使用することはできません(とあなたが複数のビューを持っているので、もし、あなたが繰り返す必要があると思います個々のビューに関するセキュリティポリシー)。

関連する問題