Is it possible to create an indexed view with SQL Server 2008 which selects from another indexed view?
create view V1 as (select 1 as abc)
create view V2 as (select abc from V1 group by abc)
Is it possible to create an indexed view with SQL Server 2008 which selects from another indexed view?
create view V1 as (select 1 as abc)
create view V2 as (select abc from V1 group by abc)
I think the answer is "no, it is not possible".
From Microsoft TechNet Site, in an article about performance:
Q. I have a view defined on top of another view. SQL Server won't let me index the top-level view. What can I do?
A. Consider expanding the definition of the nested view by hand into the top-level view, and then indexing it, indexing the innermost view, or not indexing the view.
Good Luck.
Here are the requirements for indexed views (they are plentiful):