Ankit
Ankit

Reputation: 133

How to index views with left outer join in SQL Server

I have created a view which is using LEFT OUTER JOIN in SQL Server.

I am unable to index the views because you cannot put an Index on a view with an OUTER JOIN.

Any alternatives?

Upvotes: 4

Views: 7095

Answers (1)

Adam Wenger
Adam Wenger

Reputation: 17540

Here is an article describing the use of ISNULL(table_id, 0) to create an INNER JOIN with the affect of an outer join. It may be of use to you.

The example in this article is good, should be fairly self-explanatory.

indexedViewsWithOuterJoins

Upvotes: 3

Related Questions